Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions docs_versioned_docs/version-ros2jazzy/ros/tutorials/driving.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,30 @@ sudo apt-get install ros-jazzy-teleop-twist-keyboard
Once installed, run the node:

```
ros2 run teleop_twist_keyboard teleop_twist_keyboard
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -p stamped:=true
```

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

```
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r __ns:=/j100_0001
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -p stamped:=true -r __ns:=/j100_0001
```

## Command Velocity

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

```
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist \
"linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0"
ros2 topic pub /cmd_vel geometry_msgs/msg/TwistStamped \
"twist:
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0"
```

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