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

#include <cb_lemniscate.hpp>

Inheritance diagram for cl_px4_mr::CbLemniscate:
Inheritance graph
Collaboration diagram for cl_px4_mr::CbLemniscate:
Collaboration graph

Public Member Functions

 CbLemniscate (FlightPatternFigureEightParams params={}, PathFollowerParams follower={})
 
 CbLemniscate (int count, float size=5.0f)
 
void setParams (const FlightPatternFigureEightParams &params)
 
const FlightPatternFigureEightParams & params () const
 
void setCenter (float x, float y)
 
- Public Member Functions inherited from cl_px4_mr::CbPx4PathFollowerBase
 CbPx4PathFollowerBase (PathFollowerParams params={})
 
virtual ~CbPx4PathFollowerBase ()
 
template<typename TOrthogonal , typename TSourceObject >
void onStateOrthogonalAllocation ()
 
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
 
size_t carrotVertexIndex () 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

FlightPatternFigureEightParams params_
 

Additional Inherited Members

- Protected Attributes inherited from cl_px4_mr::CbPx4PathFollowerBase
PathFollowerParams followerParams_
 
CpTunnelCentering * tunnelCentering_ = nullptr
 
- 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 29 of file cb_lemniscate.hpp.

Constructor & Destructor Documentation

◆ CbLemniscate() [1/2]

cl_px4_mr::CbLemniscate::CbLemniscate ( FlightPatternFigureEightParams params = {},
PathFollowerParams follower = {} )
explicit

Definition at line 26 of file cb_lemniscate.cpp.

28{
29}
FlightPatternFigureEightParams params_
const FlightPatternFigureEightParams & params() const
CbPx4PathFollowerBase(PathFollowerParams params={})

◆ CbLemniscate() [2/2]

cl_px4_mr::CbLemniscate::CbLemniscate ( int count,
float size = 5.0f )
explicit

Member Function Documentation

◆ behaviorName()

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

Reimplemented from cl_px4_mr::CbPx4PathFollowerBase.

Definition at line 46 of file cb_lemniscate.hpp.

46{ return "CbLemniscate"; }

◆ buildPath()

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

Implements cl_px4_mr::CbPx4PathFollowerBase.

Definition at line 37 of file cb_lemniscate.cpp.

38{
40 RCLCPP_INFO(
41 getLogger(), "CbLemniscate: %d x %s figure eight(s), lobe %.1f m, centre (%.1f, %.1f), ~%.0f m",
43 std::isnan(params_.centerX) ? current.x : params_.centerX,
44 std::isnan(params_.centerY) ? current.y : params_.centerY,
47}
virtual rclcpp::Logger getLogger() const
std::vector< NedPoint > generateFlightPatternFigureEight(const FlightPatternFigureEightParams &p, const NedPoint &current)
float flightPatternFigureEightLength(const FlightPatternFigureEightParams &p)
const char * turnName(Turn t)

References cl_px4_mr::FlightPatternFigureEightParams::centerX, cl_px4_mr::FlightPatternFigureEightParams::centerY, cl_px4_mr::FlightPatternFigureEightParams::count, cl_px4_mr::FlightPatternFigureEightParams::direction, cl_px4_mr::flightPatternFigureEightLength(), cl_px4_mr::CbPx4PathFollowerBase::followerParams_, cl_px4_mr::generateFlightPatternFigureEight(), smacc2::ISmaccClientBehavior::getLogger(), params_, cl_px4_mr::FlightPatternFigureEightParams::size, cl_px4_mr::TANGENT, cl_px4_mr::turnName(), cl_px4_mr::NedPoint::x, cl_px4_mr::NedPoint::y, and cl_px4_mr::PathFollowerParams::yawMode.

Here is the call graph for this function:

◆ params()

const FlightPatternFigureEightParams & cl_px4_mr::CbLemniscate::params ( ) const
inline

Definition at line 37 of file cb_lemniscate.hpp.

37{ return params_; }

References params_.

Referenced by setParams().

Here is the caller graph for this function:

◆ setCenter()

void cl_px4_mr::CbLemniscate::setCenter ( float x,
float y )
inline

◆ setParams()

void cl_px4_mr::CbLemniscate::setParams ( const FlightPatternFigureEightParams & params)
inline

Definition at line 36 of file cb_lemniscate.hpp.

36{ params_ = params; }

References params(), and params_.

Here is the call graph for this function:

Member Data Documentation

◆ params_

FlightPatternFigureEightParams cl_px4_mr::CbLemniscate::params_
private

Definition at line 49 of file cb_lemniscate.hpp.

Referenced by buildPath(), CbLemniscate(), params(), setCenter(), and setParams().


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