PX4 Firmware
PX4 Autopilot Software http://px4.io
UavcanHardpointController Class Reference

The UavcanHardpointController class. More...

#include <hardpoint.hpp>

Collaboration diagram for UavcanHardpointController:

Public Member Functions

 UavcanHardpointController (uavcan::INode &node)
 
 ~UavcanHardpointController ()
 
int init ()
 
void set_command (uint8_t hardpoint_id, uint16_t command)
 

Private Types

typedef uavcan::MethodBinder< UavcanHardpointController *, void(UavcanHardpointController::*)(const uavcan::TimerEvent &)> TimerCbBinder
 

Private Member Functions

void periodic_update (const uavcan::TimerEvent &)
 

Private Attributes

uavcan::equipment::hardpoint::Command _cmd
 
pthread_mutex_t _node_mutex
 
uavcan::INode & _node
 
uavcan::Publisher< uavcan::equipment::hardpoint::Command > _uavcan_pub_raw_cmd
 
uavcan::TimerEventForwarder< TimerCbBinder_timer
 

Static Private Attributes

static constexpr unsigned MAX_RATE_HZ = 1
 XXX make this configurable. More...
 

Detailed Description

The UavcanHardpointController class.

Definition at line 51 of file hardpoint.hpp.

Member Typedef Documentation

◆ TimerCbBinder

typedef uavcan::MethodBinder<UavcanHardpointController *, void (UavcanHardpointController::*)(const uavcan::TimerEvent &)> UavcanHardpointController::TimerCbBinder
private

Definition at line 79 of file hardpoint.hpp.

Constructor & Destructor Documentation

◆ UavcanHardpointController()

UavcanHardpointController::UavcanHardpointController ( uavcan::INode &  node)

Definition at line 43 of file hardpoint.cpp.

References _uavcan_pub_raw_cmd.

◆ ~UavcanHardpointController()

UavcanHardpointController::~UavcanHardpointController ( )

Definition at line 51 of file hardpoint.cpp.

Member Function Documentation

◆ init()

int UavcanHardpointController::init ( )

Definition at line 57 of file hardpoint.cpp.

References _timer, and periodic_update().

Referenced by UavcanNode::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ periodic_update()

void UavcanHardpointController::periodic_update ( const uavcan::TimerEvent &  )
private

Definition at line 87 of file hardpoint.cpp.

References _cmd, and _uavcan_pub_raw_cmd.

Referenced by init().

Here is the caller graph for this function:

◆ set_command()

void UavcanHardpointController::set_command ( uint8_t  hardpoint_id,
uint16_t  command 
)

Definition at line 67 of file hardpoint.cpp.

References _cmd, _timer, _uavcan_pub_raw_cmd, command, and MAX_RATE_HZ.

Referenced by UavcanNode::hardpoint_controller_set(), and UavcanNode::ioctl().

Here is the caller graph for this function:

Member Data Documentation

◆ _cmd

uavcan::equipment::hardpoint::Command UavcanHardpointController::_cmd
private

Definition at line 74 of file hardpoint.hpp.

Referenced by periodic_update(), and set_command().

◆ _node

uavcan::INode& UavcanHardpointController::_node
private

Definition at line 85 of file hardpoint.hpp.

◆ _node_mutex

pthread_mutex_t UavcanHardpointController::_node_mutex
private

Definition at line 81 of file hardpoint.hpp.

◆ _timer

uavcan::TimerEventForwarder<TimerCbBinder> UavcanHardpointController::_timer
private

Definition at line 87 of file hardpoint.hpp.

Referenced by init(), and set_command().

◆ _uavcan_pub_raw_cmd

uavcan::Publisher<uavcan::equipment::hardpoint::Command> UavcanHardpointController::_uavcan_pub_raw_cmd
private

Definition at line 86 of file hardpoint.hpp.

Referenced by periodic_update(), set_command(), and UavcanHardpointController().

◆ MAX_RATE_HZ

constexpr unsigned UavcanHardpointController::MAX_RATE_HZ = 1
staticprivate

XXX make this configurable.

Definition at line 72 of file hardpoint.hpp.

Referenced by set_command().


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