Giter VIP home page Giter VIP logo

turtlebot3_d435's Introduction

Turtlebot3 + RealSense D435 + Tunnel + Simple Navigation

This is my personal ROS practice example that put Turtlebot burger with Realsense D435 in a simple tunnel scene and applies a simple auto mode drive the turtlebot out of the tunnel itself.

I will describe how to import D435 into your own model/world because I found there are only few instruction about do so. For more models (e.g. D455), you can go to RealSense offical Github to find the urdf/xacro files and build the .so file yourself.

Turtlebot with D435

Configuration

Althoug the configuation should not be the problem, still I put them down below for those who would like to know.

OS: Ubuntu 20.04

ROS: noetic

Gazebo: 11

Install

  1. install ROS and packages

    sudo apt-get install ros-noetic-desktop-full

    replace the 'noetic' to other version to be competitble to your pc

  2. Download this repo

    # build your work space directories, e.g. `catkin_ws` in my example
    mkdir catkin_ws
    cd catkin_ws
    mkdir src
    cd src
    # clone the repo
    git clone 
  3. Build the project

    cd ..
    catkin_make

    this will generate a librealsense_gazebo_plugin.so file to simulate D435 in Gazebo

Explanation

Packages

  • beginner_tutorials: basic ROS operations e.g. node, topics, services

  • realsense_gazebo_plugin: to generate RealSense sensor simulation plugin for Gazebo to use

  • realsense2_description: RealSense sensor models

  • robotcontrol: simple navigation codes. The original codes are from the first link in the reference.

  • turtlebot3: turtlebot3 models

  • turtlebot3_msgs: turtlebot3 messages

  • turtlebot3_simulations: turtlebot3 simulation files (e.g. world models, .world, .launch)

Usage

💡 I kind of messed up the original turtlebot3 repos by modifying it directly, but it is still worth to play around with it 😛

Initial Setup

Link/Source the bulit project, replace catkin_ws with your workspace name:

cd catkin_ws
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bash

Setup Turtlebot default model to burger:

 echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
 source ~/.bash

Launch the world

To launch the simulation that includes turtlebot3_burger + RealSense D435 + Tunnel

roslaunch turtlebot3_gazebo turtlebot3_tunnel.launch

Self-driving

First change the permission of the files

roscd robotcontrol/src
chmod +x *.py
  1. Move the robot straight
    ./test.py
  2. Move the robot to drive out of the tunnel
    ./self_drive.py

    Currently this script cannot be terminated, you have to close the terminal. ToBeFixed!

  3. Reset the world
    ./reset.py

Import RealSense D435 into your model/wrold

  1. To generate librealsense_gazebo_plugin.so file only, make sure realsense_gazebo_plugin repo is under /src and build it.
    cd ..   # to catkin_ws
    catkin_make
    # or use catkin tool to specify which pkg to build
    catkin build realsense_gazebo_plugin
    Then you will find the file under /catkin_ws/devel/lib
  2. copy _d435.gazebo.xacro and _d435.urdf.xacro into /your_pkg/urdf where you want to simulate
  3. in the file _d435.urdf.xacro change the line 13 from
    <xacro:include filename="$(find packagename)/urdf/urdf _d435.gazebo.xacro">
    to your package_name
  4. In your model.urdf.xacro (turtlebot3_burgher.urdf.xacro in my example), put the following lines:
        <xacro:include filename="$(find packagename)/urdf/_d435.urdf.xacro" />
    ...
        <xacro:sensor_d435 name="camera" topics_ns="camera" parent="base_link" publish_pointcloud="true">
            <origin xyz="0 0 0" rpy="0 0 0" />
        </xacro:sensor_d435>
    and change your desired orginal pose related to base_link
  5. In the launch file, don't forget to publish the tf tree for rviz to visualize
        <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher">
            <param name="publish_frequency" type="double" value="30.0" />
        </node>

    For more detailes, please check the files that related to burger model or the keyword tunnel under turtlebot3_simulations/turtlebot3_gazebo.

Velodyne

Check the READMEs in velodyne_plugin_tutorial and velodune_simulator for more details.

Resource

Reference

Contact Info

If you have any question please don't hesitate to contact me:

Wen-Yu Chien: [email protected]

LinkedIn

Gitpage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.