Skip to content

Commit 8f80a37

Browse files
authored
Update jogging.md
1 parent 5d29c04 commit 8f80a37

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

ros2/jogging.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,65 @@ Copy the above into a file called "example.py" and run it using:
4343
```{.bash .shell-prompt .copy}
4444
python3 example.py
4545
```
46+
47+
## Retrieving joint limits
48+
49+
In a terminal, echo the `/joint_limits` topic:
50+
51+
```{.bash .shell-prompt .copy}
52+
ros2 topic echo /joint_limits
53+
```
54+
55+
In a second terminal, request the driver publish the joint limits:
56+
57+
```{.bash .shell-prompt .copy}
58+
ros2 service call /get_joint_states std_srvs/srv/Trigger {}
59+
```
60+
61+
In the first terminal, you'll see a single message get published. It'll look like this:
62+
63+
```yaml
64+
header:
65+
stamp:
66+
sec: 1725388967
67+
nanosec: 818893747
68+
frame_id: ''
69+
name:
70+
- joint_head_tilt
71+
- joint_wrist_pitch
72+
- joint_wrist_roll
73+
- joint_wrist_yaw
74+
- joint_head_pan
75+
- joint_lift
76+
- joint_arm
77+
- gripper_aperture
78+
- joint_gripper_finger_left
79+
- joint_gripper_finger_right
80+
position:
81+
- -2.0171847360696185
82+
- -1.5707963267948966
83+
- -2.9114955354069467
84+
- -1.3933658823294575
85+
- -4.035903452927122
86+
- 0.0
87+
- 0.0
88+
- -0.1285204486235414
89+
- -0.3757907854489514
90+
- -0.3757907854489514
91+
velocity:
92+
- 0.4908738521234052
93+
- 0.45099035163837853
94+
- 2.9176314585584895
95+
- 4.416586351787409
96+
- 1.7303303287350031
97+
- 1.0966833704348709
98+
- 0.5197662863936018
99+
- 0.34289112948906764
100+
- 1.0026056417808995
101+
- 1.0026056417808995
102+
effort: []
103+
```
104+
105+
We're misusing the [sensor_msgs/JointState](https://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/JointState.html) message to publish the joint limits. The `name` array lists out each ranged joint. The `position` array lists the lower bound for each joint. The `velocity` array lists the upper bound. The length of these 3 arrays will be equal, because the index of the joint in the `name` array determines which index the corresponding limits will be in the other two arrays.
106+
107+
The revolute joints will have their limits published in radians, and the prismatic joints will have them published in meters. See the [Hardware Overview](../../getting_started/stretch_hardware_overview/) to see the ranges represented visually.

0 commit comments

Comments
 (0)