|
SMACC2
|
#include <cp_forward_obstacle_guard.hpp>


Public Member Functions | |
| CpForwardObstacleGuard (ForwardObstacleGuardParams params={}) | |
| virtual | ~CpForwardObstacleGuard () |
| void | onInitialize () override |
| template<typename T > | |
| smacc2::SmaccSignalConnection | onObstacleTooClose (void(T::*callback)(), T *object) |
| template<typename T > | |
| smacc2::SmaccSignalConnection | onObstacleCleared (void(T::*callback)(), T *object) |
| void | reset () |
| bool | isTooClose () const |
| float | lastYawRate () const |
| float | lastMinRange () const |
| int | lastHits () const |
| const ForwardObstacleGuardParams & | params () const |
Public Member Functions inherited from smacc2::ISmaccComponent | |
| ISmaccComponent () | |
| virtual | ~ISmaccComponent () |
| virtual std::string | getName () const |
Public Attributes | |
| smacc2::SmaccSignal< void()> | onObstacleTooClose_ |
| smacc2::SmaccSignal< void()> | onObstacleCleared_ |
Private Member Functions | |
| void | onCloud (const sensor_msgs::msg::PointCloud2 &msg) |
| void | onAttitude (const px4_msgs::msg::VehicleAttitude::SharedPtr msg) |
| bool | levelRotation (std::array< float, 9 > &r) const |
Private Attributes | |
| ForwardObstacleGuardParams | params_ |
| smacc2::client_core_components::CpTopicSubscriber< sensor_msgs::msg::PointCloud2 > * | subscriber_ |
| rclcpp::Subscription< px4_msgs::msg::VehicleAttitude >::SharedPtr | attitudeSub_ |
| double | lastYaw_ = 0.0 |
| uint64_t | lastYawStampUs_ = 0 |
| std::mutex | attitudeMutex_ |
| std::array< float, 4 > | attitudeQ_ {{1.0f, 0.0f, 0.0f, 0.0f}} |
| bool | haveAttitude_ = false |
| std::atomic< float > | yawRate_ {0.0f} |
| int | gatedClouds_ = 0 |
| float | cosHalfAngle_ = 1.0f |
| int | triggerStreak_ = 0 |
| int | clearStreak_ = 0 |
| std::atomic< bool > | tooClose_ {false} |
| std::atomic< float > | lastMinRange_ {std::numeric_limits<float>::infinity()} |
| std::atomic< int > | lastHits_ {0} |
Additional Inherited Members | |
Protected Member Functions inherited from smacc2::ISmaccComponent | |
| template<typename TOrthogonal , typename TClient > | |
| void | onComponentInitialization () |
| template<typename EventType > | |
| void | postEvent (const EventType &ev) |
| template<typename EventType > | |
| void | postEvent () |
| template<typename TOrthogonal , typename TSourceObject > | |
| void | onStateOrthogonalAllocation () |
| template<typename TComponent > | |
| void | requiresComponent (TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
| template<typename TComponent > | |
| void | requiresComponent (std::string name, TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
| template<typename TClient > | |
| void | requiresClient (TClient *&requiredClientStorage) |
| template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
| SmaccComponentType * | createSiblingComponent (TArgs... targs) |
| template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
| SmaccComponentType * | createSiblingNamedComponent (std::string name, TArgs... targs) |
| rclcpp::Node::SharedPtr | getNode () |
| rclcpp::Logger | getLogger () const |
| ISmaccStateMachine * | getStateMachine () |
Protected Attributes inherited from smacc2::ISmaccComponent | |
| ISmaccStateMachine * | stateMachine_ |
| ISmaccClient * | owner_ |
Definition at line 85 of file cp_forward_obstacle_guard.hpp.
|
explicit |
Definition at line 32 of file cp_forward_obstacle_guard.cpp.
|
virtual |
Definition at line 37 of file cp_forward_obstacle_guard.cpp.
|
inline |
Definition at line 111 of file cp_forward_obstacle_guard.hpp.
References tooClose_.
|
inline |
Definition at line 114 of file cp_forward_obstacle_guard.hpp.
References lastHits_.
|
inline |
Definition at line 113 of file cp_forward_obstacle_guard.hpp.
References lastMinRange_.
|
inline |
Definition at line 112 of file cp_forward_obstacle_guard.hpp.
References yawRate_.
|
private |
Definition at line 103 of file cp_forward_obstacle_guard.cpp.
References attitudeMutex_, attitudeQ_, and haveAttitude_.
Referenced by onCloud().

|
private |
Definition at line 78 of file cp_forward_obstacle_guard.cpp.
References attitudeMutex_, attitudeQ_, haveAttitude_, lastYaw_, lastYawStampUs_, and yawRate_.
Referenced by onInitialize().

|
private |
Definition at line 136 of file cp_forward_obstacle_guard.cpp.
References cl_px4_mr::ForwardObstacleGuardParams::clearClouds, cl_px4_mr::ForwardObstacleGuardParams::clearRangeM, clearStreak_, cosHalfAngle_, cl_px4_mr::ForwardObstacleGuardParams::floorCutoffM, gatedClouds_, smacc2::ISmaccComponent::getLogger(), lastHits_, lastMinRange_, cl_px4_mr::ForwardObstacleGuardParams::levelFrame, levelRotation(), cl_px4_mr::ForwardObstacleGuardParams::maxYawRateRadS, cl_px4_mr::ForwardObstacleGuardParams::minHits, onObstacleCleared_, onObstacleTooClose_, params_, tooClose_, cl_px4_mr::ForwardObstacleGuardParams::triggerClouds, cl_px4_mr::ForwardObstacleGuardParams::triggerRangeM, triggerStreak_, and yawRate_.
Referenced by onInitialize().


|
overridevirtual |
Reimplemented from smacc2::ISmaccComponent.
Definition at line 39 of file cp_forward_obstacle_guard.cpp.
References attitudeSub_, cl_px4_mr::ForwardObstacleGuardParams::clearClouds, cl_px4_mr::ForwardObstacleGuardParams::clearRangeM, cl_px4_mr::ForwardObstacleGuardParams::floorCutoffM, smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getNode(), cl_px4_mr::ForwardObstacleGuardParams::halfAngleRad, cl_px4_mr::ForwardObstacleGuardParams::levelFrame, cl_px4_mr::ForwardObstacleGuardParams::maxYawRateRadS, cl_px4_mr::ForwardObstacleGuardParams::minHits, onAttitude(), onCloud(), smacc2::client_core_components::CpTopicSubscriber< MessageType >::onMessageReceived(), params_, smacc2::ISmaccComponent::requiresComponent(), subscriber_, cl_px4_mr::ForwardObstacleGuardParams::triggerClouds, and cl_px4_mr::ForwardObstacleGuardParams::triggerRangeM.

|
inline |
Definition at line 100 of file cp_forward_obstacle_guard.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), smacc2::ISmaccComponent::getStateMachine(), and onObstacleCleared_.
Referenced by cl_px4_mr::CbObstacleGuard::onEntry().


|
inline |
Definition at line 94 of file cp_forward_obstacle_guard.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), smacc2::ISmaccComponent::getStateMachine(), and onObstacleTooClose_.
Referenced by cl_px4_mr::CbObstacleGuard::onEntry().


|
inline |
| void cl_px4_mr::CpForwardObstacleGuard::reset | ( | ) |
Definition at line 65 of file cp_forward_obstacle_guard.cpp.
References clearStreak_, smacc2::ISmaccComponent::getLogger(), lastMinRange_, tooClose_, and triggerStreak_.
Referenced by cl_px4_mr::CbObstacleGuard::onEntry().


|
mutableprivate |
Definition at line 132 of file cp_forward_obstacle_guard.hpp.
Referenced by levelRotation(), and onAttitude().
|
private |
Definition at line 133 of file cp_forward_obstacle_guard.hpp.
Referenced by levelRotation(), and onAttitude().
|
private |
Definition at line 129 of file cp_forward_obstacle_guard.hpp.
Referenced by onInitialize().
|
private |
Definition at line 139 of file cp_forward_obstacle_guard.hpp.
|
private |
Definition at line 137 of file cp_forward_obstacle_guard.hpp.
Referenced by onCloud().
|
private |
Definition at line 136 of file cp_forward_obstacle_guard.hpp.
Referenced by onCloud().
|
private |
Definition at line 134 of file cp_forward_obstacle_guard.hpp.
Referenced by levelRotation(), and onAttitude().
|
private |
Definition at line 142 of file cp_forward_obstacle_guard.hpp.
Referenced by lastHits(), and onCloud().
|
private |
Definition at line 141 of file cp_forward_obstacle_guard.hpp.
Referenced by lastMinRange(), onCloud(), and reset().
|
private |
Definition at line 130 of file cp_forward_obstacle_guard.hpp.
Referenced by onAttitude().
|
private |
Definition at line 131 of file cp_forward_obstacle_guard.hpp.
Referenced by onAttitude().
| smacc2::SmaccSignal<void()> cl_px4_mr::CpForwardObstacleGuard::onObstacleCleared_ |
Definition at line 118 of file cp_forward_obstacle_guard.hpp.
Referenced by onCloud(), and onObstacleCleared().
| smacc2::SmaccSignal<void()> cl_px4_mr::CpForwardObstacleGuard::onObstacleTooClose_ |
Definition at line 117 of file cp_forward_obstacle_guard.hpp.
Referenced by onCloud(), and onObstacleTooClose().
|
private |
Definition at line 126 of file cp_forward_obstacle_guard.hpp.
Referenced by onCloud(), onInitialize(), and params().
|
private |
Definition at line 127 of file cp_forward_obstacle_guard.hpp.
Referenced by onInitialize().
|
private |
Definition at line 140 of file cp_forward_obstacle_guard.hpp.
Referenced by isTooClose(), onCloud(), and reset().
|
private |
Definition at line 138 of file cp_forward_obstacle_guard.hpp.
|
private |
Definition at line 135 of file cp_forward_obstacle_guard.hpp.
Referenced by lastYawRate(), onAttitude(), and onCloud().