Skip to content

Commit 94845d6

Browse files
committed
Merge from default.
2 parents 937df0c + 9a698e6 commit 94845d6

23 files changed

+1202
-6
lines changed

build_model/tutorial.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Overview
2+
13
Models can range from simple shapes to complex robots. It refers to the `<model>` [SDF](http://gazebosim.org/sdf.html) tag, and is essentially a collection of links, joints, collision objects, visuals, and plugins. Generating a model file can be difficult depending on the complexity of the desired model. This page will offer some tips on how to build your models.
24

35
# Components of Models
@@ -18,7 +20,7 @@ Models can range from simple shapes to complex robots. It refers to the `<model>
1820
1921
# Building a Model
2022

21-
###Step 1: Collect your meshes
23+
### Step 1: Collect your meshes
2224

2325
This step involves gathering all the necessary 3D mesh files that are required to build your model. Gazebo provides a set of simple shapes: box, sphere, and cylinder. If your model needs something more complex, then continue reading.
2426

@@ -33,7 +35,7 @@ Gazebo requires that mesh files be formatted as STL or Collada, with Collada bei
3335
> **Tip:** Keep meshes simple. This is especially true if you plan on using the mesh as a collision element. A common practice is to use a low polygon mesh for a collision element, and higher polygon mesh for the visual. An even better practice is to use one of the built-in shapes (box, sphere, cylinder) as the collision element.
3436
3537

36-
###Step 2: Make your model SDF file
38+
### Step 2: Make your model SDF file
3739

3840
Start by creating an extremely simple model file, or copy an existing model file. The key here is to start with something that you know works, or can debug very easily.
3941

@@ -52,7 +54,7 @@ Note that the origin of the Box-geometry is at the geometric center of the box,
5254
> **Tip:** The above example sets the simple box model to be static, which makes the model immovable. This feature is useful during model creation. Once you are done creating your model, set the `<static>` tag to false if you want your model to be movable.
5355
5456

55-
###Step 3: Add to the model SDF file
57+
### Step 3: Add to the model SDF file
5658

5759
With a working `.sdf` file, slowly start adding in more complexity. With each new addition, load the model using the graphical client to make sure your model is correct.
5860

Loading

drcsim_fakewalking/tutorial.md

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Overview
2+
3+
**IMPORTANT: This tutorial only works with ROS Groovy.**
4+
5+
This tutorial will explain how to drive simulated Atlas around as if it were a wheeled robot (i.e., without walking or balancing).
6+
7+
## Setup
8+
9+
We assume that you've already done the [installation step](http://gazebosim.org/tutorials/?tut=drcsim_install).
10+
11+
If you haven't done so, add the environment setup.sh files to your .bashrc.
12+
13+
~~~
14+
echo 'source /usr/share/drcsim/setup.sh' >> ~/.bashrc
15+
source ~/.bashrc
16+
~~~
17+
18+
We're going to use the [pr2_teleop](http://ros.org/wiki/pr2_teleop) package to drive Atlas around with keyboard commands. Install the Ubuntu package that contains it:
19+
20+
~~~
21+
sudo apt-get install ros-groovy-pr2-teleop-app
22+
~~~
23+
24+
## Background
25+
26+
Note that this tutorial does not use the [walking controller](http://gazebosim.org/tutorials/?tut=drcsim_walking&cat=drcsim). It simply spawns Atlas with position controllers enabled that keep it standing upright, as shown in the following image:
27+
28+
[[file:files/Gazebo_with_drc_robot.png|640px]]
29+
30+
Note that all of the robot's joints, including the legs, are physically simulated and actively controlled.
31+
32+
So the simulated robot in this tutorial can't walk, but we still want to move it around in the world. Fortunately, the simulated robot accepts velocity commands via ROS to translate and rotate in the plane, as if it were a wheeled robot.
33+
34+
## The code
35+
36+
1. Start the simulator:
37+
38+
~~~
39+
VRC_CHEATS_ENABLED=1 roslaunch drcsim_gazebo atlas.launch
40+
~~~
41+
42+
>**For drcsim < 3.1.0**: The package and launch file had a different name:
43+
44+
>~~~
45+
VRC_CHEATS_ENABLED=1 roslaunch atlas_utils atlas.launch
46+
>~~~
47+
48+
Note: Setting the variable `VRC_CHEATS_ENABLED=1` exposes several development aid topics including `/atlas/cmd_vel`, which are by default disabled for the VRC competition.
49+
50+
2. In another shell, start `pr2_teleop/pr2_teleop_keyboard`:
51+
52+
~~~
53+
rosrun pr2_teleop teleop_pr2_keyboard cmd_vel:=atlas/cmd_vel
54+
~~~
55+
56+
You should see something like:
57+
58+
Reading from keyboard
59+
---------------------------
60+
Use 'WASD' to translate
61+
Use 'QE' to yaw
62+
Press 'Shift' to run
63+
64+
3. Follow the instructions: get the robot moving with those keys. Press any other key to stop. Control-C to stop the teleop utility.
65+
66+
## How does that work?
67+
68+
69+
The simulated robot is awaiting [ROS Twist](http://ros.org/doc/api/geometry_msgs/html/msg/Twist.html) messages, which specify 6-D velocities, on the `atlas/cmd_vel` topic. Check that with [rostopic](http://ros.org/wiki/rostopic):
70+
71+
~~~
72+
rostopic info atlas/cmd_vel
73+
~~~
74+
75+
You should see something like:
76+
77+
~~~
78+
Type: geometry_msgs/Twist
79+
80+
Publishers:
81+
* /pr2_base_keyboard (http://osrf-Latitude-E6420:36506/)
82+
83+
Subscribers:
84+
* /gazebo (http://osrf-Latitude-E6420:35339/)
85+
~~~
86+
87+
The teleop utility is simply converting your keyboard input to messages of that type and publishing them to that topic. You can publish such messages from anywhere, including from the command line, using rostopic. First, let's see what's in a Twist message, using [rosmsg](http://ros.org/wiki/rosmsg):
88+
89+
~~~
90+
rosmsg show Twist
91+
~~~
92+
93+
You should see:
94+
95+
~~~
96+
[geometry_msgs/Twist]:
97+
geometry_msgs/Vector3 linear
98+
float64 x
99+
float64 y
100+
float64 z
101+
geometry_msgs/Vector3 angular
102+
float64 x
103+
float64 y
104+
float64 z
105+
~~~
106+
107+
It's a 6-D velocity: 3 linear velocities (X, Y, and Z) and 3 angular velocities (rotations about X, Y, Z, also called roll, pitch, and yaw). Our robot is constrained to move in the plane, so we only care about X, Y, and yaw (rotation about Z). Make the robot drive counter-clockwise in a circle:
108+
109+
~~~
110+
rostopic pub --once atlas/cmd_vel geometry_msgs/Twist '{ linear: { x: 0.5, y: 0.0, z: 0.0 }, angular: { x: 0.0, y: 0.0, z: 0.5 } }'
111+
~~~
112+
113+
Note that the robot keeps moving after rostopic exits; that's because there's no watchdog that requires recent receipt of a velocity command (that may change in the future). You can verify that no commands are being sent with this with the command:
114+
115+
~~~
116+
rostopic echo atlas/cmd_vel
117+
~~~
118+
119+
To stop the robot, send zero velocities:
120+
121+
~~~
122+
rostopic pub --once atlas/cmd_vel geometry_msgs/Twist '{ linear: { x: 0.0, y: 0.0, z: 0.0 }, angular: { x: 0.0, y: 0.0, z: 0.0 } }'
123+
~~~
124+
125+
From here, you're ready to write code that moves the robot around the world.

0 commit comments

Comments
 (0)