Skip to content

Commit e55fe52

Browse files
authored
add documentation (Kinovarobotics#150)
1 parent 056be22 commit e55fe52

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,60 @@ ros2 launch kinova_gen3_7dof_robotiq_2f_85_moveit_config robot.launch.py \
201201
```
202202
**Note: If you have reassigned your physical arm's robot IP address, then you will need to assign that ip address to `robot_ip`**
203203

204+
You can command the arm by publishing Joint Trajectory messages directly to the joint trajectory controller:
205+
```bash
206+
ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/JointTrajectory "{
207+
joint_names: [joint_1, joint_2, joint_3, joint_4, joint_5, joint_6, joint_7],
208+
points: [
209+
{ positions: [0, 0, 0, 0, 0, 0, 0], time_from_start: { sec: 10 } },
210+
]
211+
}" -1
212+
```
213+
214+
You can also command the arm using TwistStamped messages. Before doing so, you must active the `twist_controller` and deactivate the `joint_trajectory_controller`:
215+
```bash
216+
ros2 service call /controller_manager/switch_controller controller_manager_msgs/srv/SwitchController "{
217+
activate_controllers: [twist_controller],
218+
deactivate_controllers: [joint_trajectory_controller],
219+
strictness: 1,
220+
activate_asap: true,
221+
}"
222+
```
223+
224+
Once the `twist_controller` is activated, You can publish TwistStamped messages on the `/twist_controller/commands` topic to command the arm.
225+
226+
For example, you can jog the arm with the following command:
227+
```bash
228+
ros2 topic pub /twist_controller/commands geometry_msgs/TwistStamped "{
229+
header: auto,
230+
twist: {
231+
linear: {x: .05, y: 0, z: 0},
232+
angular: {x: 0,y: 0,z: 0},
233+
}
234+
}" -1
235+
```
236+
237+
Then stop it with the following command:
238+
```bash
239+
ros2 topic pub /twist_controller/commands geometry_msgs/TwistStamped "{
240+
header: auto,
241+
twist: {
242+
linear: {x: 0, y: 0, z: 0},
243+
angular: {x: 0,y: 0,z: 0},
244+
}
245+
}" -1
246+
```
247+
248+
If you wish to use the `joint_trajectory_controller` again to command the arm using JointTrajectory messages, run the following:
249+
```bash
250+
ros2 service call /controller_manager/switch_controller controller_manager_msgs/srv/SwitchController "{
251+
activate_controllers: [joint_trajectory_controller],
252+
deactivate_controllers: [twist_controller],
253+
strictness: 1,
254+
activate_asap: true,
255+
}"
256+
```
257+
204258
The Robotiq 2f 85 Gripper will be available on the Action topic:
205259

206260
```bash

0 commit comments

Comments
 (0)