In this example, we'll work on 3D simulation for TurtleBot 2 using RViz in ROS.
In this file (ros\ros_demo\src\turtlebot_sim\turtlebot_qazdoora.py
), you'll find a code that rotates and moves the TurtleBot robot.
We'll apply it on a virtual TurtleBot robot in a 3D simulation environment.
Add the movement Python file in your package (turtlebot_sim
directory in our case).
sudo apt-get install ros-kinetic-turtlebot-*
roslaunch turtlebot_stage turtlebot_in_stage.launch
After running this command, RViz simulation will start with TurtleBot robot.
In case of TURTLEBOT_STAGE_MAP_FILE
error, try to use these commands in terminal:
export TURTLEBOT_STAGE_WORLD_FILE="/opt/ros/kinetic/share/turtlebot_stage/maps/stage/maze.world"
export TURTLEBOT_STAGE_MAP_FILE="/opt/ros/kinetic/share/turtlebot_stage/maps/maze.yaml"
Also, after running the same command; you can see the 2D stage for TurtleBot robot:
Try to apply the movement code on TurtleBot in RViz environemt