PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
Loading...
Searching...
No Matches
px4_ros2::SurfaceVehiclePositionSetpointType Class Reference

Setpoint type for surface vehicle position control. More...

#include <px4_ros2/control/setpoint_types/experimental/surface_vehicle/position.hpp>

Inheritance diagram for px4_ros2::SurfaceVehiclePositionSetpointType:
px4_ros2::SetpointBase

Public Member Functions

 SurfaceVehiclePositionSetpointType (Context &context)
 
SetpointType getSetpointType () override
 
float desiredUpdateRateHz () override
 
void update (const Eigen::Vector2f &target_ned, const std::optional< Eigen::Vector2f > &start_ned={}, std::optional< float > cruising_speed={}, std::optional< float > arrival_speed={}, std::optional< float > yaw={})
 Send a position setpoint to the flight controller.
 
- Public Member Functions inherited from px4_ros2::SetpointBase
 SetpointBase (Context &context)
 
std::shared_ptr< SetpointBase > getSharedPtr ()
 
virtual void clearOptionalRequirements (px4_msgs::msg::SetpointConfigReply &setpoint_config_reply)
 
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 ()
 

Detailed Description

Setpoint type for surface vehicle position control.

Can be used for surface vehicles, i.e. rovers and boats.

Member Function Documentation

◆ desiredUpdateRateHz()

float px4_ros2::SurfaceVehiclePositionSetpointType::desiredUpdateRateHz ( )
inlineoverridevirtual

Reimplemented from px4_ros2::SetpointBase.

◆ getSetpointType()

SetpointType px4_ros2::SurfaceVehiclePositionSetpointType::getSetpointType ( )
inlineoverridevirtual

Returns one of px4_msgs::msg::SetpointType::TYPE_*

Implements px4_ros2::SetpointBase.

◆ update()

void px4_ros2::SurfaceVehiclePositionSetpointType::update ( const Eigen::Vector2f &  target_ned,
const std::optional< Eigen::Vector2f > &  start_ned = {},
std::optional< float >  cruising_speed = {},
std::optional< float >  arrival_speed = {},
std::optional< float >  yaw = {} 
)

Send a position setpoint to the flight controller.

Parameters
target_ned[m] Target position in NED frame. Takes values in [-inf, inf].
start_ned[m] Start position which specifies a line for the vehicle to track (Optional, defaults to vehicle position). Takes values in [-inf, inf].
cruising_speed[m/s] Cruising speed (Optional, defaults to maximum speed). Takes values in [0, inf].
arrival_speed[m/s] Speed the vehicle should arrive at the target with (Optional, defaults to zero). Takes values in [0, inf].
yaw[rad] Omnidirectional vehicles only: Specify vehicle yaw during travel (Optional, defaults to vehicle yaw). Takes values in [-pi,pi].

The documentation for this class was generated from the following file: