Note: This tutorial assumes that you have completed the previous tutorials: 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. |
Control Modes
Description: Details on the control modes available for the qbmoveKeywords: qbrobotics qbmove control
Tutorial Level: BEGINNER
Next Tutorial: GUI Control
For the sake of simplicity, we are going to cover all the control modes for a single qbmove, but it is just a matter of putting things together and set the launch file parameters properly to control several devices together (qb_chain_control is dedicated for such a scope).
All the control modes are initialized in the same manner but with distinct command line arguments. The default single-device control Node which brings everything up and simply waits for commands on the above mentioned Action topic is the following:
roslaunch qb_move_control control.launch standalone:=true activate_on_initialization:=true device_id:=<actual_device_id>
activate_on_initialization [false]: Activates the motors at startup (the device will not move since the first command reference is received).
device_id [1]: Each device has its own ID, you need to set the one of the actual device connect to your system.
standalone [false]: Starts the Communication Handler together with the control Node. If you set this to false (or remove it since the default value is false), you need to launch the Communication Handler in a separate terminal.
It is worth noting that the activation of the motors can be postponed to improved safety if you are not aware of the state of the system at startup. To do so just set activate_on_initialization:=false (or remove it since the default value is false) and make a call to the Communication Handler activate_motors Service, when your system is ready, e.g. as follows:
rosservice call /communication_handler/activate_motors {"id: <actual_device_id>, max_repeats: 0"}
control_duration [0.01]: The duration of the control loop expressed in seconds.
get_currents [true]: Choose whether or not to retrieve current measurements from the device.
get_positions [true]: Choose whether or not to retrieve position measurements from the device.
get_distinct_packages [false]: Choose whether or not to retrieve current and position measurements from the device in two distinct packages.
max_repeats [3]: The maximum number of consecutive repetitions to mark retrieved data as corrupted.
set_commands [true]: Choose whether or not to send command positions to the device.
set_commands_async [false]: Choose whether or not to send commands without waiting for ack.
use_rviz [true]: Choose whether or not to use rviz. If enabled you should see a virtual hand on screen performing a similar behavior.
The followings are particular control modes which are enabled with few parameters, but the concepts of this paragraph hold for all of them:
- GUI Control
Control the qbmove through a simple GUI
- Waypoint Control
Control the qbmove motion through an automatic waypoint trajectory loop
- API Control
Custom control application using the qbrobotics API