|
PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
|
Setpoint type for trajectory control. More...
#include <px4_ros2/control/setpoint_types/experimental/trajectory.hpp>
Public Member Functions | |
| TrajectorySetpointType (Context &context, bool local_position_is_optional=false) | |
| SetpointType | getSetpointType () override |
| void | clearOptionalRequirements (px4_msgs::msg::SetpointConfigReply &setpoint_config_reply) override |
| void | update (const Eigen::Vector3f &velocity_ned_m_s, const std::optional< Eigen::Vector3f > &acceleration_ned_m_s2={}, std::optional< float > yaw_ned_rad={}, std::optional< float > yaw_rate_ned_rad_s={}) |
| void | update (const TrajectorySetpoint &setpoint) |
| Update the setpoint with full flexibility by passing a TrajectorySetpoint. | |
| void | updatePosition (const Eigen::Vector3f &position_ned_m) |
| Position setpoint update. | |
Public Member Functions inherited from px4_ros2::SetpointBase | |
| SetpointBase (Context &context) | |
| std::shared_ptr< SetpointBase > | getSharedPtr () |
| virtual float | desiredUpdateRateHz () |
| void | setShouldActivateCallback (const ShouldActivateCB &should_activate_cb) |
| void | setActive (bool active) |
Additional Inherited Members | |
Public Types inherited from px4_ros2::SetpointBase | |
| using | ShouldActivateCB = std::function< void()> |
| using | SetpointType = decltype(px4_msgs::msg::SetpointConfig::type) |
Protected Member Functions inherited from px4_ros2::SetpointBase | |
| void | onUpdate () |
Setpoint type for trajectory control.
Control entries must not be contradicting.
|
explicit |
setting local_position_is_optional to true allows to create a mode that uses trajectory setpoint but doesn't necessarly require local position. Sending XY position setpoint without a correct source of positional data is not recommended
|
overridevirtual |
Allows a setpoint class to clear an optional requirement. This is for setpoint types that support multiple variations, for example some that require local position and others that do not.
| setpoint_config_reply | input and output config |
Reimplemented from px4_ros2::SetpointBase.
|
inlineoverridevirtual |
Returns one of px4_msgs::msg::SetpointType::TYPE_*
Implements px4_ros2::SetpointBase.
| void px4_ros2::TrajectorySetpointType::update | ( | const TrajectorySetpoint & | setpoint | ) |
Update the setpoint with full flexibility by passing a TrajectorySetpoint.
| setpoint | a TrajectorySetpoint object where position, velocity and acceleration can be set individually for full flexibility |
| void px4_ros2::TrajectorySetpointType::updatePosition | ( | const Eigen::Vector3f & | position_ned_m | ) |
Position setpoint update.
The MulticopterGotoSetpointType should be preferred.
| position_ned_m | [m] NED earth-fixed frame |