Skip to content

Commit 1afef26

Browse files
authored
Merge pull request #518 from iRobotEducation/asoragna/forum-516-511
Improve `cmd_vel` and wall-follow docs
2 parents a4a2bb5 + c74646c commit 1afef26

File tree

4 files changed

+75
-1
lines changed

4 files changed

+75
-1
lines changed

docs/api/docking.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Through the ROS 2[^1] APIs users can command docking and undocking autonomous be
99

1010
In order for the robot to detect the dock, determine its location, and understand when it is succesfully docked, it is necessary that the docking station is connected to a power source.
1111

12-
## Built-in docking behaviors
12+
## Autonomous behaviors
1313

1414
#### Undocking
1515

docs/api/moving-the-robot.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Moving the Robot
2+
3+
This page describes the various APIs available to move the Create® 3 robot via ROS 2[^1].
4+
5+
!!! important
6+
Supervise your robot while executing movements, to avoid risk of damaging it or its surroundings.
7+
8+
!!! important
9+
It's recommended to not try to command robot motions if the robot is on its docking station.
10+
Either lift it and place it somewhere else or use the built-in [undocking behavior](../docking/#undocking).
11+
12+
13+
## Velocity Control
14+
15+
The velocity control API is the simplest way to move the Create® 3 robot.
16+
It's recommended for beginners and to simply try out the robot.
17+
Being the lowest-level motion API exposed by the robot, this is also recommended to the more advanced users who want to implement their own autonomous navigation applications.
18+
19+
The robot is controlled by publishing [geometry_msgs/msg/Twist](https://github.com/ros2/common_interfaces/blob/rolling/geometry_msgs/msg/Twist.msg) messages to the `/cmd_vel` topic.
20+
For example, to move the robot straight forward using the ROS 2 command line:
21+
22+
```bash
23+
ros2 topic pub -r 20 /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.2, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"
24+
```
25+
26+
The robot will execute the last received message on the topic until a fixed timeout period has passed or a new message is received, at which point the timer is restarted and this process begins again.
27+
The purpose of the timeout is to provide an easy way to stop the robot, i.e. just stop sending messages rather than having to send an explicit "0", and to prevent the robot to keep moving if it has lost connectivity with the process controlling it (e.g. a script on the user's laptop).
28+
29+
<!---
30+
THIS PARAMETER IS NOT YET AVAILABLE: uncomment after release
31+
The timeout is controlled by a ROS 2 parameter provided by the `/motion_control` node and named `/wheels_stop_threshold_sec`.
32+
This parameter can't be modified at runtime.
33+
You can change the value of this parameter using the application ROS 2 parameters file exposed by the webserver (see details [here](../webserver/application/#application-ros-2-parameters-file)), for example adding this snippet to the file
34+
35+
```yaml
36+
motion_control:
37+
ros__parameters:
38+
wheels_stop_threshold_sec: 0.1
39+
```
40+
41+
You can read the currently set value using ROS 2 command line tools:
42+
43+
```bash
44+
ros2 param get /motion_control wheels_stop_threshold_sec
45+
```
46+
--->
47+
48+
Note that these raw velocity commands have lower "priority" than the other request-based approaches to move the robot (described in the next sections).
49+
The request of a position control or autonomous behavior goal will block the execution of the `cmd_vel` messages, which will be ignored until the goal terminates.
50+
The corollary is that it's of no use to publish `cmd_vel` messages while those are running; you should rather first wait for the behavior to finish or actively cancel it.
51+
52+
## Position Control
53+
54+
The position control APIs are suitable for users who want to implement simple high-level strategies, such as driving a specific pattern.
55+
Basic position control, based on the internal dead-reckoning estimate of the robot, is exposed to the user via ROS 2 action goals.
56+
See the [drive goals documentation](drive-goals.md) for details.
57+
58+
## Autonomous Behaviors
59+
60+
The Create® 3 robot exposes some autonomous behaviors suitable for more specific situations.
61+
These behaviors are controlled using ROS 2 action goals.
62+
63+
- [Docking and Undocking](docking.md)
64+
- [Obstacle Following](wall-follow.md)
65+
66+
67+
[^1]: ROS 2 is governed by Open Robotics

docs/api/wall-follow.md

+6
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@ The `follow_side` can be specified as left (1) or right (-1) see the [action int
1515
The robot will use a spiraling motion to try to engage with the obstacles.
1616
The spiral will be clockwise if `follow_side` is left (1) or counter-clockwise if `follow_side` is right (-1).
1717

18+
!!! attention
19+
**If your Create® 3 robot has additional equipment mounted on top, you need to ensure that the obstacles being followed have enough vertical clearance. **
20+
21+
This behavior won't take into account the potentially increased height of the robot, so it may get stuck and damage your equipment or furniture.
22+
If the obstacles you are trying to follow have gaps from the ground or low-hanging parts, it's required that the vertical clearance is either lower than the robot's base height (roughly 12 cm), such that the robot won't try to get underneath, or higher than the height of the robot, so that it will fully fit.
23+
1824
[^1]: ROS 2 is governed by Open Robotics
1925
[^2]: All trademarks mentioned are the property of their respective owners.

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ nav:
100100
- Fast DDS Discovery Server: setup/discovery-server.md
101101
- APIs:
102102
- ROS 2 Interface: api/ros2.md
103+
- Moving the Robot: api/moving-the-robot.md
103104
- Docking: api/docking.md
104105
- Drive Goals: api/drive-goals.md
105106
- Hazards: api/hazards.md

0 commit comments

Comments
 (0)