Browse Source

Merge branch 'ROS2' into galactic

pull/1/head
Chintan Desai 2 years ago
committed by GitHub
parent
commit
e3df239738
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 12 deletions
  1. +3
    -3
      gazebo_basics.md
  2. +2
    -2
      internal_state_of_stretch.md
  3. +2
    -2
      rviz_basics.md
  4. +6
    -5
      teleoperating_stretch.md

+ 3
- 3
gazebo_basics.md View File

@ -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
```

+ 2
- 2
internal_state_of_stretch.md View File

@ -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)

+ 2
- 2
rviz_basics.md View File

@ -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.

+ 6
- 5
teleoperating_stretch.md View File

@ -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.

Loading…
Cancel
Save