SMACC2
Loading...
Searching...
No Matches
cl_px4_mr::CbSineWaveVertical Class Reference

#include <cb_sine_wave_vertical.hpp>

Inheritance diagram for cl_px4_mr::CbSineWaveVertical:
Inheritance graph
Collaboration diagram for cl_px4_mr::CbSineWaveVertical:
Collaboration graph

Public Member Functions

 CbSineWaveVertical (FlightPatternSineWaveVerticalParams params={}, PathFollowerParams follower={})
 
void setParams (const FlightPatternSineWaveVerticalParams &params)
 
const FlightPatternSineWaveVerticalParams & params () const
 
void setEndPoint (float x, float y)
 
- Public Member Functions inherited from cl_px4_mr::CbPx4PathFollowerBase
 CbPx4PathFollowerBase (PathFollowerParams params={})
 
virtual ~CbPx4PathFollowerBase ()
 
void setFollowerParams (const PathFollowerParams &params)
 
const PathFollowerParams & followerParams () const
 
void onEntry () override
 
void onExit () override
 
void update () override
 
- Public Member Functions inherited from cl_px4_mr::CbPx4ClientBehaviorBase
template<typename TOrthogonal , typename TSourceObject >
void onStateOrthogonalAllocation ()
 
virtual ~CbPx4ClientBehaviorBase ()
 
void setTimeout (std::chrono::milliseconds timeout)
 
bool hasTimeout () const
 
- Public Member Functions inherited from smacc2::SmaccAsyncClientBehavior
template<typename TOrthogonal , typename TSourceObject >
void onStateOrthogonalAllocation ()
 
virtual ~SmaccAsyncClientBehavior ()
 
template<typename TCallback , typename T >
smacc2::SmaccSignalConnection onSuccess (TCallback callback, T *object)
 
template<typename TCallback , typename T >
smacc2::SmaccSignalConnection onFinished (TCallback callback, T *object)
 
template<typename TCallback , typename T >
smacc2::SmaccSignalConnection onFailure (TCallback callback, T *object)
 
void requestForceFinish ()
 
void executeOnEntry () override
 
void executeOnExit () override
 
void waitOnEntryThread (bool requestFinish)
 
template<typename TCallbackMethod , typename T >
smacc2::SmaccSignalConnection onSuccess (TCallbackMethod callback, T *object)
 
template<typename TCallbackMethod , typename T >
smacc2::SmaccSignalConnection onFinished (TCallbackMethod callback, T *object)
 
template<typename TCallbackMethod , typename T >
smacc2::SmaccSignalConnection onFailure (TCallbackMethod callback, T *object)
 
- Public Member Functions inherited from smacc2::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachine * getStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)
 
template<typename SmaccComponentType >
void requiresComponent (std::string name, SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)
 
- Public Member Functions inherited from smacc2::ISmaccUpdatable
 ISmaccUpdatable ()
 
 ISmaccUpdatable (rclcpp::Duration duration)
 
void executeUpdate (rclcpp::Node::SharedPtr node)
 
void setUpdatePeriod (rclcpp::Duration duration)
 

Protected Member Functions

std::vector< NedPoint > buildPath (const NedPoint &current) override
 
const char * behaviorName () const override
 
- Protected Member Functions inherited from cl_px4_mr::CbPx4PathFollowerBase
virtual void onPathStarted (const std::vector< NedPoint > &)
 
virtual void onPathCompleted ()
 
float totalLength () const
 
float progressFraction () const
 
- Protected Member Functions inherited from cl_px4_mr::CbPx4ClientBehaviorBase
virtual void wireCompletionSignals ()
 
void postPx4Success ()
 
void postPx4Failure ()
 
- Protected Member Functions inherited from smacc2::SmaccAsyncClientBehavior
void postSuccessEvent ()
 
void postFailureEvent ()
 
virtual void dispose () override
 
bool isShutdownRequested ()
 onEntry is executed in a new thread. However the current state cannot be left until the onEntry thread finishes. This flag can be checked from the onEntry thread to force finishing the thread.
 
- Protected Member Functions inherited from smacc2::ISmaccClientBehavior
virtual void runtimeConfigure ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
ISmaccState * getCurrentState ()
 
virtual rclcpp::Node::SharedPtr getNode () const
 
virtual rclcpp::Logger getLogger () const
 
- Protected Member Functions inherited from smacc2::ISmaccUpdatable

Private Attributes

FlightPatternSineWaveVerticalParams params_
 

Additional Inherited Members

- Protected Attributes inherited from cl_px4_mr::CbPx4PathFollowerBase
PathFollowerParams followerParams_
 
- Protected Attributes inherited from cl_px4_mr::CbPx4ClientBehaviorBase
CpVehicleCommand * vehicleCommand_ = nullptr
 
CpVehicleStatus * vehicleStatus_ = nullptr
 
CpTrajectorySetpoint * trajectorySetpoint_ = nullptr
 
CpGoalChecker * goalChecker_ = nullptr
 
CpVehicleLocalPosition * localPosition_ = nullptr
 
CpOffboardKeepAlive * offboardKeepAlive_ = nullptr
 

Detailed Description

Definition at line 32 of file cb_sine_wave_vertical.hpp.

Constructor & Destructor Documentation

◆ CbSineWaveVertical()

cl_px4_mr::CbSineWaveVertical::CbSineWaveVertical ( FlightPatternSineWaveVerticalParams params = {},
PathFollowerParams follower = {} )
explicit

Definition at line 26 of file cb_sine_wave_vertical.cpp.

29{
30}
CbPx4PathFollowerBase(PathFollowerParams params={})
FlightPatternSineWaveVerticalParams params_
const FlightPatternSineWaveVerticalParams & params() const

Member Function Documentation

◆ behaviorName()

const char * cl_px4_mr::CbSineWaveVertical::behaviorName ( ) const
inlineoverrideprotectedvirtual

Reimplemented from cl_px4_mr::CbPx4PathFollowerBase.

Definition at line 48 of file cb_sine_wave_vertical.hpp.

48{ return "CbSineWaveVertical"; }

◆ buildPath()

std::vector< NedPoint > cl_px4_mr::CbSineWaveVertical::buildPath ( const NedPoint & current)
overrideprotectedvirtual

Implements cl_px4_mr::CbPx4PathFollowerBase.

Definition at line 32 of file cb_sine_wave_vertical.cpp.

33{
35 followerParams_.prependCurrentPosition = false; // path starts at the entry point
36
37 const float peakVerticalSpeed = params_.amplitude * 2.0f * static_cast<float>(M_PI) *
39 if (peakVerticalSpeed > 2.0f)
40 {
41 RCLCPP_WARN(
42 getLogger(),
43 "CbSineWaveVertical: peak vertical speed %.2f m/s exceeds typical PX4 limits - the flown "
44 "sine will flatten",
45 peakVerticalSpeed);
46 }
47 RCLCPP_INFO(
48 getLogger(), "CbSineWaveVertical: to (%.1f, %.1f), A=%.1f m, lambda=%.1f m", params_.endX,
51}
virtual rclcpp::Logger getLogger() const
std::vector< NedPoint > generateFlightPatternSineWaveVertical(const FlightPatternSineWaveVerticalParams &p, const NedPoint &current)

References cl_px4_mr::FlightPatternSineWaveVerticalParams::amplitude, cl_px4_mr::FlightPatternSineWaveVerticalParams::endX, cl_px4_mr::FlightPatternSineWaveVerticalParams::endY, cl_px4_mr::CbPx4PathFollowerBase::followerParams_, cl_px4_mr::generateFlightPatternSineWaveVertical(), smacc2::ISmaccClientBehavior::getLogger(), cl_px4_mr::PathFollowerParams::groundSpeed, params_, cl_px4_mr::PathFollowerParams::prependCurrentPosition, cl_px4_mr::TANGENT, cl_px4_mr::FlightPatternSineWaveVerticalParams::wavelength, and cl_px4_mr::PathFollowerParams::yawMode.

Here is the call graph for this function:

◆ params()

const FlightPatternSineWaveVerticalParams & cl_px4_mr::CbSineWaveVertical::params ( ) const
inline

Definition at line 39 of file cb_sine_wave_vertical.hpp.

39{ return params_; }

References params_.

Referenced by setParams().

Here is the caller graph for this function:

◆ setEndPoint()

void cl_px4_mr::CbSineWaveVertical::setEndPoint ( float x,
float y )
inline

◆ setParams()

void cl_px4_mr::CbSineWaveVertical::setParams ( const FlightPatternSineWaveVerticalParams & params)
inline

Definition at line 38 of file cb_sine_wave_vertical.hpp.

38{ params_ = params; }

References params(), and params_.

Here is the call graph for this function:

Member Data Documentation

◆ params_

FlightPatternSineWaveVerticalParams cl_px4_mr::CbSineWaveVertical::params_
private

Definition at line 51 of file cb_sine_wave_vertical.hpp.

Referenced by buildPath(), params(), setEndPoint(), and setParams().


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