Browse Source

Merge c0048336cb into 6323ff3006

pull/36/merge
Binit Shah 2 years ago
committed by GitHub
parent
commit
bf203f41c1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 9 deletions
  1. +26
    -7
      stretch_gazebo/README.md
  2. +1
    -1
      stretch_gazebo/config/sim.rviz
  3. +1
    -1
      stretch_gazebo/launch/gazebo.launch

+ 26
- 7
stretch_gazebo/README.md View File

@ -16,14 +16,14 @@ The *config* directory contains rviz files and [ros_control](http://wiki.ros.org
* Head: [position_controllers/JointTrajectoryController](http://wiki.ros.org/joint_trajectory_controller) * Head: [position_controllers/JointTrajectoryController](http://wiki.ros.org/joint_trajectory_controller)
* Joints: [joint_state_controller/JointStateController](http://wiki.ros.org/joint_state_controller) * Joints: [joint_state_controller/JointStateController](http://wiki.ros.org/joint_state_controller)
The *launch* directory includes two files:
The *launch* directory includes:
* gazebo.launch: Opens up an empty Gazebo world and spawns the robot loading all the controllers, including all the sensors except Cliff sensors and respeaker.
* teleop_keyboard.launch: Allows keyboard teleop in the terminal and remaps *cmd_vel* topics to */stretch_diff_drive_controller/cmd_vel*, which the robot is taking velocity commands from.
* teleop_joy.launch: Spawns a joy and teleop_twist_joy instance and remaps *cmd_vel* topics to */stretch_diff_drive_controller/cmd_vel*, which the robot is taking velocity commands from. Note that the *teleop_twist_joy* package has a deadman switch by default which disables the drive commands to be published unless it is being pressed. For an Logitech F310 joystick this button is A.
* `gazebo.launch`: Opens up an empty Gazebo world and spawns the robot loading all the controllers, including all the sensors except Cliff sensors and respeaker.
The *script* directory contains a single python file that publishes ground truth odometry of the robot from Gazebo. The *script* directory contains a single python file that publishes ground truth odometry of the robot from Gazebo.
The *worlds* directory contains a sample [Gazebo world](http://gazebosim.org/tutorials?tut=ros_roslaunch#WorldFiles) file(s) that can be used to configure the environment in which Stretch is spawned.
## Setup ## Setup
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: 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:
@ -38,7 +38,9 @@ rosdep install --from-paths src --ignore-src -r -y
catkin_make catkin_make
``` ```
## Running Demo
## Running Stretch Gazebo
![](../images/gazebo.png)
```bash ```bash
# Terminal 1: # Terminal 1:
@ -49,9 +51,14 @@ roslaunch stretch_core teleop_twist.launch twist_topic:=/stretch_diff_drive_cont
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*. 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*.
![](../images/gazebo.png)
By default, Gazebo initializes Stretch in an empty environment. To initialize Gazebo with a different environment, use the "world" ROS argument to point to a [world file](http://gazebosim.org/tutorials?tut=ros_roslaunch#WorldFiles). The *worlds* directory within Stretch Gazebo, contains a sample world called "random_objects.world" and can be launched like this:
```bash
roslaunch stretch_gazebo gazebo.launch rviz:=true world:=`rospack find stretch_gazebo`/worlds/random_objects.world
```
## Running Gazebo with MoveIt! and Stretch
### Running Stretch Gazebo with MoveIt! and Twist Teleop
```bash ```bash
# Terminal 1: # Terminal 1:
@ -71,6 +78,10 @@ This will launch an Rviz instance that visualizes the joints with markers and an
![](../images/gazebo_moveit.gif) ![](../images/gazebo_moveit.gif)
### Running Stretch Gazebo with Stretch Navigation
See the Stretch Navigation [README](../stretch_navigation/README.md#running-in-simulation) for an explanation of the `mapping_gazebo.launch` and `navigation_gazebo.launch` launch files, which allow for mapping and navigation within the Gazebo simulated world.
## Differences in Gazebo vs Stretch ## Differences in Gazebo vs Stretch
The simulated Stretch RE1 differs from the robot in the following ways. The simulated Stretch RE1 differs from the robot in the following ways.
@ -96,6 +107,14 @@ Actuators are defined as *ros_control* transmission objects in Gazebo using [Pos
We provide [stretch_calibration](../stretch_calibration/README.md) to generate a calibrated URDF that is unique to each robot. The calibrated URDF is generated from the nominal description of Stretch RE1, the xacro files that live in [stretch_description](../stretch_description/README.md). The simulated Stretch RE1 is generated from the gazebo xacro description in the *urdf directory* and is not calibrated. We provide [stretch_calibration](../stretch_calibration/README.md) to generate a calibrated URDF that is unique to each robot. The calibrated URDF is generated from the nominal description of Stretch RE1, the xacro files that live in [stretch_description](../stretch_description/README.md). The simulated Stretch RE1 is generated from the gazebo xacro description in the *urdf directory* and is not calibrated.
### Topic Names
| Stretch | Gazebo |
|:---------------------:|:--------------------------------------:|
| /stretch/cmd_vel | /stretch_diff_drive_controller/cmd_vel |
| /odom | /stretch_diff_drive_controller/odom |
| /stretch/joint_states | /joint_states |
## License ## License
For license information, please see the LICENSE files. For license information, please see the LICENSE files.

+ 1
- 1
stretch_gazebo/config/sim.rviz View File

@ -318,7 +318,7 @@ Visualization Manager:
Size (Pixels): 3 Size (Pixels): 3
Size (m): 0.009999999776482582 Size (m): 0.009999999776482582
Style: Flat Squares Style: Flat Squares
Topic: /realsense/depth/color/points
Topic: /camera/depth/color/points
Unreliable: false Unreliable: false
Use Fixed Frame: true Use Fixed Frame: true
Use rainbow: true Use rainbow: true

+ 1
- 1
stretch_gazebo/launch/gazebo.launch View File

@ -18,7 +18,7 @@
<arg name="paused" value="$(arg paused)"/> <arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="$(arg use_sim_time)"/> <arg name="use_sim_time" value="$(arg use_sim_time)"/>
<arg name="headless" value="$(arg headless)"/> <arg name="headless" value="$(arg headless)"/>
<arg name="verbose" value="true"/>
<arg name="verbose" value="false"/>
</include> </include>
<param name="robot_description" command="$(find xacro)/xacro $(arg model) gpu_lidar:=$(arg gpu_lidar) visualize_lidar:=$(arg visualize_lidar)" /> <param name="robot_description" command="$(find xacro)/xacro $(arg model) gpu_lidar:=$(arg gpu_lidar) visualize_lidar:=$(arg visualize_lidar)" />

Loading…
Cancel
Save