|Note: This tutorial assumes that you have completed the previous tutorials: qbmove Setup, qbmove GUI Control.|
|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
qbmove Waypoint ControlDescription: Control the qbmove motion through an automatic waypoint loop
Keywords: qbmove control waypoints
Tutorial Level: INTERMEDIATE
Next Tutorial: qbmove API Control
This control mode is a bit more structured and useful than the previous: it allow to set a fixed trajectory of any number of position waypoints (with timing constraints) and set the robot to cycle infinitely on it (because of the loop it is recommended to set the first and last waypoint in a similar configuration to avoid unwanted sudden changes).
A qbmove properly connected to your system (cf. qbmove Setup tutorial).
- Set the current device ID in the launch file:
Open the qb_move_control/launch/waypoint_control.launch.
Check if the device_id argument is set with ID you have annotated before.
- If not, simply change it with the current ID.
With this mode, you can modify the waypoint trajectory to replicate the behavior you want: you can either modify the qb_move_control/config/qbmove_waypoints.yaml or add another custom application-specific <namespace>_waypoints.yaml file in the config directory. In the second case you need also to modify the launch file accordingly, i.e. set waypoint_namespace with the chosen <namespace>.
The waypoint configuration is as follows: you can specify the values you want, but the names are fixed a part from <namespace> which is the one you need:
# Waypoints describe the desired motion trajectory: # - time [s]: can be either a single value or an interval for which joint_positions hold # - joint_positions: can be either (depending on the controller) # - shaft position [radians] and stiffness preset [0,1]; # - motor_1 and motor_2 positions [radians]. waypoints: - time: [1.0] joint_positions: <namespace>: [0.0, 0.0] - time: [2.75, 3.25] joint_positions: <namespace>: [1.57, 0.0] - ...
To start the ROS node open a terminal and execute the following command:
roslaunch qb_move_control waypoint_control.launch
If you have made any modifications at the C++ code (this does not apply for .xml launch files and .yaml configuration files), remember to recompile the the whole Catkin Workspace (cf. qbmove ROS Packages Installation).
You won't see any control interface in this case but the qbmove should start moving according to the given trajectory.
If rviz is enabled (look at the launch file and see if use_rviz is set to true) you should see a virtual cube on screen performing a similar behavior, i.e. moving the shaft and both the actuators accordingly.