Low Level Motion¶
The LowLevelMotion
class provides an interface for very efficient planning of motion between joint-space waypoints. Low level motions are not checked for collisions, but they are real-time capable and much faster to compute than other motion types and allow for more flexible constraints. This motion type is suitable for visual servoing task or other real-time control.
First, we construct a LowLevelMotion
with a unique name, the robot that should execute the motion, and a start and goal waypoint:
low_level_motion = LowLevelMotion('low-level-motion', robot,
start=grasp_waypoint,
goal=place_waypoint,
)
grasp_to_place_motion.robot.max_acceleration = [5.0, 5.0, 6.0, 10.0, 10.0, 12.0] # [rad/s^2]
LowLevelMotion low_level_motion {"low-level-motion", robot,
grasp_waypoint,
place_waypoint
};
grasp_to_place_motion.robot.max_acceleration = {5.0, 5.0, 6.0, 10.0, 10.0, 12.0}; // [rad/s^2]
Compared to other motion types, LowLevelMotion
allows more fine-grained control over the trajectory profile. For example, you can specify a minimum duration for the motion:
low_level_motion.minimum_duration = 5.0 # [s]
low_level_motion.minimum_duration = 5.0; // [s]
Moreover, you can choose how the temporal profile of each degree of freedom is synchronized, with the following options:
Phase synchronization - when possible, else fallback to time synchronization,
Time synchronization - all DoFs reach the target at the same time,
Time-if-necessary synchronization - synchronizes DoFs only when necessary (e.g. for non-zero target velocity or acceleration),
No synchronization - each DoF is planned independently.
In this example, let’s choose time synchronization:
low_level_motion.synchronization = 'Time'
low_level_motion.synchronization = Synchronization::Time;
Additionally, you can specify the control interface, depending on if you want position control (full control over the entire kinematic state) or velocity control (ignores the current position, target position and velocity limits).
low_level_motion.control_interface = 'Position'
low_level_motion.control_interface = ControlInterface::Position;
Finally, you can control the type of duration discretization, which can be either Continuous
(every trajectory synchronization duration is allowed) or Discrete
(the trajectory synchronization duration must be a multiple of the cycle time).
low_level_motion.duration_discretization = 'Discrete'
low_level_motion.duration_discretization = DurationDiscretization::Discrete;
In the next tutorial, we will take a look at the BimanualMotion
class, which is a specialized motion type for planning trajectories for dual-arm robots.