Browse Source

Update documentation for Stretch Navigation README

pull/30/merge
Binit Shah 3 years ago
parent
commit
fdd467dcf9
4 changed files with 58 additions and 36 deletions
  1. +17
    -16
      stretch_gazebo/README.md
  2. +0
    -11
      stretch_gazebo/launch/teleop_joy.launch
  3. +0
    -7
      stretch_gazebo/launch/teleop_keyboard.launch
  4. +41
    -2
      stretch_navigation/README.md

+ 17
- 16
stretch_gazebo/README.md View File

@ -29,21 +29,22 @@ The *script* directory contains a single python file that publishes ground truth
These set up instructions will not be required on newly shipped robots. Follow these instructions if *stretch_gazebo* is not present in your ROS workspace or you are simulating Stretch on external hardware. Clone stretch_ros and realsense_gazebo_plugin packages to your catkin workspace. Then install dependencies and build the packages, with the following set of commands:
```bash
cd ~/catkin_ws/src
git clone https://github.com/hello-robot/stretch_ros
git clone https://github.com/pal-robotics/realsense_gazebo_plugin
cd ~/catkin_ws
rosdep install --from-paths src --ignore-src -r -y
catkin_make
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/hello-robot/stretch_ros
git clone https://github.com/pal-robotics/realsense_gazebo_plugin
cd ~/catkin_ws
rosdep install --from-paths src --ignore-src -r -y
catkin_make
```
## Running Demo
```bash
# Terminal 1:
roslaunch stretch_gazebo gazebo.launch rviz:=true
# Terminal 2:
roslaunch stretch_gazebo teleop_keyboard.launch # or use teleop_joy.launch if you have a controller
# Terminal 1:
roslaunch stretch_gazebo gazebo.launch rviz:=true
# Terminal 2:
roslaunch stretch_core teleop_twist.launch twist_topic:=/stretch_diff_drive_controller/cmd_vel linear:=1.0 angular:=2.0 teleop_type:=keyboard # or use teleop_type:=joystick if you have a controller
```
This will launch an Rviz instance that visualizes the sensors and an empty world in Gazebo with Stretch and load all the controllers. Although, the base will be able to move with the joystick commands, the joystick won't give joint commands to arm, head or gripper. To move these joints see the next section about *Running Gazebo with MoveIt! and Stretch*.
@ -53,12 +54,12 @@ This will launch an Rviz instance that visualizes the sensors and an empty world
## Running Gazebo with MoveIt! and Stretch
```bash
# Terminal 1:
roslaunch stretch_gazebo gazebo.launch
# Terminal 2:
roslaunch stretch_gazebo teleop_keyboard.launch # or use teleop_joy.launch if you have a controller
# Terminal 3
roslaunch stretch_moveit_config demo_gazebo.launch
# Terminal 1:
roslaunch stretch_gazebo gazebo.launch
# Terminal 2:
roslaunch stretch_core teleop_twist.launch twist_topic:=/stretch_diff_drive_controller/cmd_vel linear:=1.0 angular:=2.0 teleop_type:=keyboard # or use teleop_type:=joystick if you have a controller
# Terminal 3
roslaunch stretch_moveit_config demo_gazebo.launch
```
This will launch an Rviz instance that visualizes the joints with markers and an empty world in Gazebo with Stretch and load all the controllers. There are pre-defined positions for each joint group for demonstration purposes. There are three joint groups, namely *stretch_arm*, *stretch_gripper* and *stretch_head* that can be controlled individually via Motion Planning Rviz plugin. Start and goal positions for joints can be selected similar to [this moveit tutorial](https://ros-planning.github.io/moveit_tutorials/doc/quickstart_in_rviz/quickstart_in_rviz_tutorial.html#choosing-specific-start-goal-states). A few notes to be kept in mind:

+ 0
- 11
stretch_gazebo/launch/teleop_joy.launch View File

@ -1,11 +0,0 @@
<?xml version="1.0"?>
<launch>
<node name="joy" pkg="joy" type="joy_node" output="screen">
<param name="dev" value="/dev/input/js0"/>
<param name="autorepeat_rate" value="20" />
</node>
<node name="teleop_twist_joy" pkg="teleop_twist_joy" type="teleop_node">
<remap from="cmd_vel" to="/stretch_diff_drive_controller/cmd_vel"/>
</node>
</launch>

+ 0
- 7
stretch_gazebo/launch/teleop_keyboard.launch View File

@ -1,7 +0,0 @@
<launch>
<node name="teleop_twist_keyboard" pkg="teleop_twist_keyboard" type="teleop_twist_keyboard.py" output="screen" >
<remap from="/cmd_vel" to="/stretch_diff_drive_controller/cmd_vel" />
</node>
</launch>

+ 41
- 2
stretch_navigation/README.md View File

@ -6,9 +6,18 @@
## Setup
Use `rosdep` to install the required packages.
These set up instructions are already performed on Stretch RE1 robots. Follow these instructions if *stretch_navigation* is not present in your ROS workspace or you are simulating Stretch on external hardware. Clone stretch_ros to your catkin workspace. Then install dependencies and build the packages, with the following set of commands:
## Running Demo
```bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/hello-robot/stretch_ros
cd ~/catkin_ws
rosdep install --from-paths src --ignore-src -r -y
catkin_make
```
## Quickstart
The first step is to map the space that the robot will navigate in. The `mapping.launch` will enable you to do this. First run:
@ -35,6 +44,36 @@ Rviz will show the robot in the previously mapped space, however, it's likely th
It is also possible to send 2D Pose Estimates and Nav Goals programatically. In your own launch file, you may include `navigation.launch` to bring up the navigation stack. Then, you can send `move_base_msgs::MoveBaseGoal` messages in order to navigate the robot programatically.
### Running in Simulation
To perform mapping and navigation in the Gazebo simulation of Stretch, substitute the `mapping_gazebo.launch` and `navigation_gazebo.launch` launch files into the commands above. The default Gazebo environment is the Willow Garage HQ. Use the "world" ROS argument to specify the Gazebo world within which to spawn Stretch.
```bash
roslaunch stretch_navigation mapping_gazebo.launch gazebo_world:=worlds/willowgarage.world
```
### Teleop using a Joystick Controller
The mapping launch files, `mapping.launch` and `mapping_gazebo.launch` expose the ROS argument, "teleop_type". By default, this ROS arg is set to "keyboard", which launches keyboard teleop in the terminal. If the xbox controller that ships with Stretch RE1 is plugged into your computer, the following command will launch mapping with joystick teleop:
```bash
roslaunch stretch_navigation mapping.launch teleop_type:=joystick
```
### Using ROS Remote Master
If you have set up [ROS Remote Master](https://docs.hello-robot.com/untethered_operation/#ros-remote-master) for [untethered operation](https://docs.hello-robot.com/untethered_operation/), you can use Rviz and teleop locally with the following commands:
```bash
# On Robot
roslaunch stretch_navigation mapping.launch rviz:=false teleop_type:=none
# On your machine, Terminal 1:
rviz -d `rospack find stretch_navigation`/rviz/mapping.launch
# On your machine, Terminal 2:
roslaunch stretch_core teleop_twist.launch teleop_type:=keyboard # or use teleop_type:=joystick if you have a controller
```
## License
For license information, please see the LICENSE files.

Loading…
Cancel
Save