diff --git a/gazebo_basics.md b/gazebo_basics.md index a215561..a92c857 100644 --- a/gazebo_basics.md +++ b/gazebo_basics.md @@ -7,7 +7,7 @@ Refer to the instructions below if you want to test this functionality in ROS 1. ### Empty World Simulation To spawn the Stretch in gazebo's default empty world run the following command in your terminal. -```bash +``` roslaunch stretch_gazebo gazebo.launch ``` This will bringup the robot in the gazebo simulation similar to the image shown below. @@ -17,14 +17,14 @@ This will bringup the robot in the gazebo simulation similar to the image shown ### Custom World Simulation In gazebo, you are able to spawn Stretch in various worlds. First, source the gazebo world files by running the following command in a terminal -```BASH +``` echo "source /usr/share/gazebo/setup.sh" ``` Then using the world argument, you can spawn the stretch in the willowgarage world by running the following -```bash +``` roslaunch stretch_gazebo gazebo.launch world:=worlds/willowgarage.world ``` diff --git a/internal_state_of_stretch.md b/internal_state_of_stretch.md index ed72b8c..c5e502a 100644 --- a/internal_state_of_stretch.md +++ b/internal_state_of_stretch.md @@ -11,6 +11,7 @@ ros2 topic echo /stretch/joint_states ``` Your terminal will then output the information associated with the `/stretch/joint_states` topic. Your `header`, `position`, `velocity`, and `effort` information may vary from what is printed below. + ``` header: seq: 70999 @@ -26,7 +27,6 @@ velocity: [0.00015598730463972836, -0.00029395074514369584, -0.00028038454542173 effort: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] --- ``` - Additionally, if you type `ros2 topic list` in the terminal, you will see the list of active topics being published. A powerful tool to visualize the ROS communication is through the rqt_graph package. You can see a graph of topics being communicated between nodes by typing the following. @@ -38,4 +38,4 @@ ros2 run rqt_graph rqt_graph The graph allows a user to observe and affirm if topics are broadcasted to the correct nodes. This method can also be utilized to debug communication issues. -**Next Tutorial:** [RViz Basics](rviz_basics.md) +**Next Tutorial:** [RViz Basics](rviz_basics.md) \ No newline at end of file diff --git a/rviz_basics.md b/rviz_basics.md index 63af975..2245e4b 100644 --- a/rviz_basics.md +++ b/rviz_basics.md @@ -23,10 +23,10 @@ TODO: Add the correct link for working with rviz2 in ROS 2 There are further tutorials for RViz that can be found [here](http://wiki.ros.org/rviz/Tutorials). -## Running RViz and Gazebo +## Running RViz and Gazebo (Simulation) Let's bringup stretch in the willowgarage world from the [gazebo basics tutorial](gazebo_basics.md) and RViz by using the following command. -```bash +``` roslaunch stretch_gazebo gazebo.launch world:=worlds/willowgarage.world rviz:=true ``` the `rviz` flag will open an RViz window to visualize a variety of ROS topics. diff --git a/teleoperating_stretch.md b/teleoperating_stretch.md index 8fefcd9..fca77da 100644 --- a/teleoperating_stretch.md +++ b/teleoperating_stretch.md @@ -34,18 +34,19 @@ If you're done, hold down the Shutdown PC button for 2 seconds. This will cause ### Keyboard Teleoperating -To teleoperate a Stretch's **mobile base** with the keyboard, you first need to set the ros parameter to *navigation* mode in order for the robot to receive *Twist* messages. Begin by running `roscore` in a terminal. Then in a new terminal, type the following commands +To teleoperate a Stretch's mobile base with the keyboard, you first need to set the ros parameter to *navigation* mode for the robot to receive *Twist* messages. Begin by running `roscore` in a terminal. Then in a new terminal, type the following commands -```bash +``` rosparam set /stretch_driver/mode "navigation" roslaunch stretch_core stretch_driver.launch ``` The first line will set the stretch driver mode to *navigation* before running the `stretch_driver.launch` file. Then in a new terminal launch the teleop_twist_keyboard node with the argument remapping the *cmd_vel* topic name to *stretch/cmd_vel*. -```bash +``` rosrun teleop_twist_keyboard teleop_twist_keyboard.py cmd_vel:=stretch/cmd_vel ``` + Below are the keyboard commands that allow a user to move Stretch. ``` Reading from the keyboard and Publishing to Twist! @@ -93,7 +94,7 @@ roslaunch stretch_gazebo gazebo.launch In a new terminal, type the following -```bash +``` roslaunch stretch_gazebo teleop_keyboard.launch ``` The same keyboard commands will be presented to a user to move the robot. @@ -101,7 +102,7 @@ The same keyboard commands will be presented to a user to move the robot. ### Xbox Controller Teleoperating An alternative for robot base teleoperation is to use an Xbox controller. Stop the keyboard teleoperation node by typing **Ctrl** + **c** in the terminal where the command was executed. Then connect the Xbox controller device to your local machine and run the following command. -```bash +``` roslaunch stretch_gazebo teleop_joy.launch ``` Note that the teleop_twist_joy package has a deadman switch by default which disables the drive commands to be published unless pressed. For a Logitech F310 joystick, this button is A.