Skip to content

Commit 56b937a

Browse files
authored
Update drive commands for Jazzy with TwistStamped (#453)
1 parent 4631bae commit 56b937a

File tree

1 file changed

+12
-11
lines changed
  • docs_versioned_docs/version-ros2jazzy/ros/tutorials

1 file changed

+12
-11
lines changed

docs_versioned_docs/version-ros2jazzy/ros/tutorials/driving.mdx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,30 @@ sudo apt-get install ros-jazzy-teleop-twist-keyboard
4444
Once installed, run the node:
4545

4646
```
47-
ros2 run teleop_twist_keyboard teleop_twist_keyboard
47+
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -p stamped:=true
4848
```
4949

5050
If your robot uses a namespace, the namespace should be applied to `teleop_twist_keyboard`:
5151

5252
```
53-
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r __ns:=/j100_0001
53+
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -p stamped:=true -r __ns:=/j100_0001
5454
```
5555

5656
## Command Velocity
5757

5858
You can manually publish to the `cmd_vel` topic through the command line by calling:
5959

6060
```
61-
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist \
62-
"linear:
63-
x: 0.0
64-
y: 0.0
65-
z: 0.0
66-
angular:
67-
x: 0.0
68-
y: 0.0
69-
z: 0.0"
61+
ros2 topic pub /cmd_vel geometry_msgs/msg/TwistStamped \
62+
"twist:
63+
linear:
64+
x: 0.0
65+
y: 0.0
66+
z: 0.0
67+
angular:
68+
x: 0.0
69+
y: 0.0
70+
z: 0.0"
7071
```
7172

7273
Set the `linear.x` value to drive the robot forwards or backwards, and the `angular.z` value to rotate left or right.

0 commit comments

Comments
 (0)