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

Setpoint type for surface vehicle speed and steering control. More...

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

Inheritance diagram for px4_ros2::SurfaceVehicleSpeedSteeringSetpointType:
px4_ros2::SetpointBase

Public Member Functions

 SurfaceVehicleSpeedSteeringSetpointType (Context &context)
 
SetpointType getSetpointType () override
 
float desiredUpdateRateHz () override
 
void update (float speed_body_x, float normalized_steering_setpoint, std::optional< float > speed_body_y={})
 Send a speed setpoint and a steering 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 speed and steering control.

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

Member Function Documentation

◆ desiredUpdateRateHz()

float px4_ros2::SurfaceVehicleSpeedSteeringSetpointType::desiredUpdateRateHz ( )
inlineoverridevirtual

Reimplemented from px4_ros2::SetpointBase.

◆ getSetpointType()

SetpointType px4_ros2::SurfaceVehicleSpeedSteeringSetpointType::getSetpointType ( )
inlineoverridevirtual

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

Implements px4_ros2::SetpointBase.

◆ update()

void px4_ros2::SurfaceVehicleSpeedSteeringSetpointType::update ( float  speed_body_x,
float  normalized_steering_setpoint,
std::optional< float >  speed_body_y = {} 
)

Send a speed setpoint and a steering setpoint to the flight controller.

Parameters
speed_body_x[m/s] Speed setpoint in body x direction. Takes values in [-inf (Backwards), inf (Forwards)].
normalized_steering_setpoint[-] Normalized steering setpoint. Ackermann rovers: Normalized steering angle, Differential/Mecanum rovers: Normalized speed difference between the left and right wheels, Boats: Normalized steering command. Takes values in [-1 (Left), 1 (Right)].
speed_body_y[m/s] Speed setpoint in body y direction (Optional, only relevant for omnidirectional vehicles, ignored by all other vehicles). Takes values in [-inf (Left), inf (Right)].

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