Twist Handler¶
The twist interface, allowing you to easily specify cartesian speeds.
-
class
twist_handler.
TwistHandler
(name, controller='twist_controller', debug=False, self_contained=False)¶ The twist interface
- Parameters
name (str) – Name of the Action Server
controller (str) – The twist controller to use. Options are:
twist_controller
debug (bool) – Turn on debug print statements
self_contained (bool) – Decide whether to set jog speed back to zero when object is deleted.
-
build_twist
(linear, angular)¶ Build a twist message from vectors
- Parameters
linear (list) – The linear twist components [x,y,z]
angular (list) – The angular twist components [x,y,z]
- Returns
twist – The resulting twist message
- Return type
geometry_msgs/Twist
-
convert_units
(twist, direction='to_ros')¶ Convert units from the units defined in the trajectory config to ROS default units (or vice versa).
- Parameters
twist (dict) – twist to parse
direction (str) – Which direction to convert. Options are
to_ros
orfrom_ros
.
- Returns
twist – Converted twist
- Return type
dict
-
load_config
(filename, directory=None)¶ Load a configuration from a file
- Parameters
filename (str) – Filename of configuration to load
directory (str) – Directory where config files should be loaded from. Default is the config folder of this package
-
set_config
(config)¶ Set the configuration
- Parameters
config (dict) – Configuration to set
-
set_speed_factor
(speed_factor)¶ Set the speed multiplier
- Parameters
speed_factor (float) – Speed multiplier to use
-
set_twist
(twist)¶ Run a trajectory.
- Parameters
twist (dict or geometrty_msgs/Twist) – Twist to set.
-
shutdown
()¶ Shut down gracefully