SMACC2
Loading...
Searching...
No Matches
cl_px4_mr::CbPx4PathFollowerBase Class Referenceabstract

#include <cb_px4_path_follower_base.hpp>

Inheritance diagram for cl_px4_mr::CbPx4PathFollowerBase:
Inheritance graph
Collaboration diagram for cl_px4_mr::CbPx4PathFollowerBase:
Collaboration graph

Public Member Functions

 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

virtual std::vector< NedPoint > buildPath (const NedPoint &current)=0
 
virtual const char * behaviorName () const
 
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

Protected Attributes

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
 

Private Member Functions

NedPoint commandFor (float s)
 
void applyCentering (NedPoint &cmd) const
 
float tangentYawAt (size_t segmentIndex) const
 

Private Attributes

std::vector< NedPoint > path_
 
std::vector< float > cumLen_
 
float totalLen_ = 0.0f
 
float sCarrot_ = 0.0f
 
std::atomic< size_t > carrotVertex_ {0}
 
float entryHeading_ = 0.0f
 
NedPoint lastCmd_
 
int lastProgressDecile_ = -1
 
std::atomic< bool > active_ {false}
 
std::chrono::steady_clock::time_point lastUpdateTime_
 

Detailed Description

Definition at line 81 of file cb_px4_path_follower_base.hpp.

Constructor & Destructor Documentation

◆ CbPx4PathFollowerBase()

cl_px4_mr::CbPx4PathFollowerBase::CbPx4PathFollowerBase ( PathFollowerParams params = {})
explicit

Definition at line 33 of file cb_px4_path_follower_base.cpp.

◆ ~CbPx4PathFollowerBase()

virtual cl_px4_mr::CbPx4PathFollowerBase::~CbPx4PathFollowerBase ( )
inlinevirtual

Definition at line 85 of file cb_px4_path_follower_base.hpp.

85{}

Member Function Documentation

◆ applyCentering()

void cl_px4_mr::CbPx4PathFollowerBase::applyCentering ( NedPoint & cmd) const
private

Definition at line 261 of file cb_px4_path_follower_base.cpp.

262{
263 if (
265 !tunnelCentering_->valid() || localPosition_ == nullptr)
266 {
267 return;
268 }
269 const float up = tunnelCentering_->verticalOffsetM(); // > 0: climb
270 cmd.z -= up;
271 // the lateral offset is measured in the vehicle's own heading frame (the
272 // lidar's); apply it only while that heading agrees with the path tangent -
273 // mid-turn "left" can point straight at the wall the path leads away from
274 const float heading = localPosition_->getHeading();
275 const float misalign = wrapPi(heading - cmd.yaw);
276 if (std::fabs(misalign) > 0.7854f)
277 {
278 return;
279 }
280 const float lateral = tunnelCentering_->lateralOffsetM(); // > 0: left of the vehicle
281 // NED: heading psi from north toward east; left of forward = (sin psi, -cos psi)
282 const float s = std::sin(heading);
283 const float c = std::cos(heading);
284 cmd.x += lateral * s;
285 cmd.y -= lateral * c;
286}
float wrapPi(float angle)

References followerParams_, cl_px4_mr::CpVehicleLocalPosition::getHeading(), cl_px4_mr::CpTunnelCentering::lateralOffsetM(), cl_px4_mr::CbPx4ClientBehaviorBase::localPosition_, tunnelCentering_, cl_px4_mr::PathFollowerParams::useTunnelCentering, cl_px4_mr::CpTunnelCentering::valid(), cl_px4_mr::CpTunnelCentering::verticalOffsetM(), cl_px4_mr::wrapPi(), cl_px4_mr::NedPoint::x, cl_px4_mr::NedPoint::y, cl_px4_mr::NedPoint::yaw, and cl_px4_mr::NedPoint::z.

Referenced by commandFor().

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

◆ behaviorName()

virtual const char * cl_px4_mr::CbPx4PathFollowerBase::behaviorName ( ) const
inlineprotectedvirtual

◆ buildPath()

virtual std::vector< NedPoint > cl_px4_mr::CbPx4PathFollowerBase::buildPath ( const NedPoint & current)
protectedpure virtual

◆ carrotVertexIndex()

size_t cl_px4_mr::CbPx4PathFollowerBase::carrotVertexIndex ( ) const
inlineprotected

Definition at line 119 of file cb_px4_path_follower_base.hpp.

119{ return carrotVertex_.load(); }

References carrotVertex_.

Referenced by cl_px4_mr::CbFollowNedPath::reachedCount().

Here is the caller graph for this function:

◆ commandFor()

NedPoint cl_px4_mr::CbPx4PathFollowerBase::commandFor ( float s)
private

Definition at line 232 of file cb_px4_path_follower_base.cpp.

233{
234 size_t segment = 0;
235 NedPoint cmd = sampleAtArcLength(path_, cumLen_, s, &segment);
236
237 switch (followerParams_.yawMode)
238 {
239 case YawMode::FIXED:
241 break;
243 cmd.yaw = entryHeading_;
244 break;
246 if (std::isnan(cmd.yaw))
247 {
248 cmd.yaw = tangentYawAt(segment);
249 }
250 break;
251 case YawMode::TANGENT:
252 default:
253 cmd.yaw = tangentYawAt(segment);
254 break;
255 }
256 cmd.yaw = wrapPi(cmd.yaw);
257 applyCentering(cmd);
258 return cmd;
259}
float tangentYawAt(size_t segmentIndex) const
NedPoint sampleAtArcLength(const std::vector< NedPoint > &path, const std::vector< float > &cum, float s, size_t *segmentIndex=nullptr)

References applyCentering(), cumLen_, entryHeading_, cl_px4_mr::FIXED, cl_px4_mr::PathFollowerParams::fixedYaw, followerParams_, cl_px4_mr::HOLD_ENTRY, path_, cl_px4_mr::PER_VERTEX, cl_px4_mr::sampleAtArcLength(), cl_px4_mr::TANGENT, tangentYawAt(), cl_px4_mr::wrapPi(), cl_px4_mr::NedPoint::yaw, and cl_px4_mr::PathFollowerParams::yawMode.

Referenced by onEntry(), and update().

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

◆ followerParams()

const PathFollowerParams & cl_px4_mr::CbPx4PathFollowerBase::followerParams ( ) const
inline

Definition at line 96 of file cb_px4_path_follower_base.hpp.

96{ return followerParams_; }

References followerParams_.

◆ onEntry()

void cl_px4_mr::CbPx4PathFollowerBase::onEntry ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 35 of file cb_px4_path_follower_base.cpp.

36{
37 if (localPosition_ == nullptr || trajectorySetpoint_ == nullptr)
38 {
39 RCLCPP_ERROR(
40 getLogger(), "%s: local position / trajectory setpoint component missing - posting failure",
41 behaviorName());
42 this->postPx4Failure();
43 return;
44 }
45 if (!localPosition_->isValid())
46 {
47 RCLCPP_ERROR(
48 getLogger(), "%s: no valid local position at entry - posting failure", behaviorName());
49 this->postPx4Failure();
50 return;
51 }
52
53 NedPoint current;
54 current.x = localPosition_->getX();
55 current.y = localPosition_->getY();
56 current.z = localPosition_->getZ();
57 current.yaw = localPosition_->getHeading();
58 entryHeading_ = current.yaw;
59
60 std::vector<NedPoint> raw = buildPath(current);
61 if (raw.empty())
62 {
63 RCLCPP_ERROR(
64 getLogger(), "%s: buildPath() returned no vertices - posting failure", behaviorName());
65 this->postPx4Failure();
66 return;
67 }
68
69 path_.clear();
71 {
72 NedPoint start = current;
73 start.yaw = std::numeric_limits<float>::quiet_NaN();
74 path_.push_back(start);
75 }
76 for (const NedPoint & v : raw)
77 {
78 if (!path_.empty() && nedDistance(path_.back(), v) < followerParams_.minSegmentLength)
79 {
80 // keep the later vertex's yaw, drop the degenerate segment
81 path_.back().yaw = std::isnan(v.yaw) ? path_.back().yaw : v.yaw;
82 continue;
83 }
84 path_.push_back(v);
85 }
86
88 totalLen_ = cumLen_.empty() ? 0.0f : cumLen_.back();
89 sCarrot_ = 0.0f;
90 carrotVertex_ = 0;
92
93 const float speed = std::max(followerParams_.groundSpeed, 0.05f);
94 const float lag = speed / 0.95f;
95 if (followerParams_.leash < 1.2f * lag)
96 {
97 RCLCPP_WARN(
98 getLogger(),
99 "%s: leash %.1f m is below 1.2x the expected tracking lag (%.1f m at %.1f m/s) - effective "
100 "speed will be throttled to ~%.1f m/s",
101 behaviorName(), followerParams_.leash, lag, speed, 0.95f * followerParams_.leash);
102 }
103
104 if (!this->hasTimeout() && followerParams_.autoTimeoutFactor > 0.0f)
105 {
106 const float seconds = std::max(30.0f, followerParams_.autoTimeoutFactor * totalLen_ / speed);
107 this->setTimeout(std::chrono::milliseconds(static_cast<int64_t>(seconds * 1000.0f)));
108 RCLCPP_INFO(getLogger(), "%s: auto-timeout armed at %.0f s", behaviorName(), seconds);
109 }
110
111 RCLCPP_INFO(
112 getLogger(),
113 "%s: following %zu vertices, %.1f m at %.1f m/s (leash %.1f m) from NED (%.1f, %.1f, %.1f) "
114 "to (%.1f, %.1f, %.1f)%s",
115 behaviorName(), path_.size(), totalLen_, speed, followerParams_.leash, path_.front().x,
116 path_.front().y, path_.front().z, path_.back().x, path_.back().y, path_.back().z,
118 ? (tunnelCentering_ ? " + tunnel centering"
119 : " (tunnel centering requested but no component)")
120 : "");
122
123 lastCmd_ = commandFor(0.0f);
125 lastUpdateTime_ = std::chrono::steady_clock::now();
126 active_ = true;
127}
void setTimeout(std::chrono::milliseconds timeout)
std::chrono::steady_clock::time_point lastUpdateTime_
virtual std::vector< NedPoint > buildPath(const NedPoint &current)=0
virtual void onPathStarted(const std::vector< NedPoint > &)
void setPositionNED(float x, float y, float z, float yaw=std::numeric_limits< float >::quiet_NaN())
virtual rclcpp::Logger getLogger() const
float nedDistance(const NedPoint &a, const NedPoint &b)
std::vector< float > cumulativeLengths(const std::vector< NedPoint > &path)

References active_, cl_px4_mr::PathFollowerParams::autoTimeoutFactor, behaviorName(), buildPath(), carrotVertex_, commandFor(), cumLen_, cl_px4_mr::cumulativeLengths(), entryHeading_, followerParams_, cl_px4_mr::CpVehicleLocalPosition::getHeading(), smacc2::ISmaccClientBehavior::getLogger(), cl_px4_mr::CpVehicleLocalPosition::getX(), cl_px4_mr::CpVehicleLocalPosition::getY(), cl_px4_mr::CpVehicleLocalPosition::getZ(), cl_px4_mr::PathFollowerParams::groundSpeed, cl_px4_mr::CbPx4ClientBehaviorBase::hasTimeout(), cl_px4_mr::CpVehicleLocalPosition::isValid(), lastCmd_, lastProgressDecile_, lastUpdateTime_, cl_px4_mr::PathFollowerParams::leash, cl_px4_mr::CbPx4ClientBehaviorBase::localPosition_, cl_px4_mr::PathFollowerParams::minSegmentLength, cl_px4_mr::nedDistance(), onPathStarted(), path_, cl_px4_mr::CbPx4ClientBehaviorBase::postPx4Failure(), cl_px4_mr::PathFollowerParams::prependCurrentPosition, sCarrot_, cl_px4_mr::CpTrajectorySetpoint::setPositionNED(), cl_px4_mr::CbPx4ClientBehaviorBase::setTimeout(), totalLen_, cl_px4_mr::CbPx4ClientBehaviorBase::trajectorySetpoint_, tunnelCentering_, cl_px4_mr::PathFollowerParams::useTunnelCentering, cl_px4_mr::NedPoint::x, cl_px4_mr::NedPoint::y, cl_px4_mr::NedPoint::yaw, and cl_px4_mr::NedPoint::z.

Here is the call graph for this function:

◆ onExit()

void cl_px4_mr::CbPx4PathFollowerBase::onExit ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 129 of file cb_px4_path_follower_base.cpp.

130{
131 if (active_.exchange(false))
132 {
133 // hold at the last carrot (not hold(): that would step the setpoint back
134 // to the lagging vehicle position)
136 RCLCPP_INFO(
137 getLogger(), "%s: exiting at %.0f%% - holding at last setpoint (%.1f, %.1f, %.1f)",
139 }
140}

References active_, behaviorName(), smacc2::ISmaccClientBehavior::getLogger(), lastCmd_, progressFraction(), cl_px4_mr::CpTrajectorySetpoint::setPositionNED(), cl_px4_mr::CbPx4ClientBehaviorBase::trajectorySetpoint_, cl_px4_mr::NedPoint::x, cl_px4_mr::NedPoint::y, cl_px4_mr::NedPoint::yaw, and cl_px4_mr::NedPoint::z.

Here is the call graph for this function:

◆ onPathCompleted()

virtual void cl_px4_mr::CbPx4PathFollowerBase::onPathCompleted ( )
inlineprotectedvirtual

Definition at line 111 of file cb_px4_path_follower_base.hpp.

111{}

Referenced by update().

Here is the caller graph for this function:

◆ onPathStarted()

virtual void cl_px4_mr::CbPx4PathFollowerBase::onPathStarted ( const std::vector< NedPoint > & )
inlineprotectedvirtual

Definition at line 110 of file cb_px4_path_follower_base.hpp.

110{}

Referenced by onEntry().

Here is the caller graph for this function:

◆ onStateOrthogonalAllocation()

template<typename TOrthogonal , typename TSourceObject >
void cl_px4_mr::CbPx4PathFollowerBase::onStateOrthogonalAllocation ( )
inline

Definition at line 88 of file cb_px4_path_follower_base.hpp.

89 {
90 // optional, may live in another orthogonal (state machine thread, see the locking rule)
93 }
void requiresComponent(SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)

References cl_px4_mr::CbPx4ClientBehaviorBase::onStateOrthogonalAllocation(), smacc2::ISmaccClientBehavior::requiresComponent(), smacc2::SOFT, and tunnelCentering_.

Here is the call graph for this function:

◆ progressFraction()

float cl_px4_mr::CbPx4PathFollowerBase::progressFraction ( ) const
inlineprotected

Definition at line 114 of file cb_px4_path_follower_base.hpp.

114{ return totalLen_ > 0.0f ? sCarrot_ / totalLen_ : 1.0f; }

References sCarrot_, and totalLen_.

Referenced by onExit(), and update().

Here is the caller graph for this function:

◆ setFollowerParams()

void cl_px4_mr::CbPx4PathFollowerBase::setFollowerParams ( const PathFollowerParams & params)
inline

Definition at line 95 of file cb_px4_path_follower_base.hpp.

95{ followerParams_ = params; }

References followerParams_.

◆ tangentYawAt()

float cl_px4_mr::CbPx4PathFollowerBase::tangentYawAt ( size_t segmentIndex) const
private

Definition at line 214 of file cb_px4_path_follower_base.cpp.

215{
216 if (path_.size() < 2)
217 {
218 return entryHeading_;
219 }
220 const size_t i0 = std::min(segmentIndex, path_.size() - 2);
221 const NedPoint & a = path_[i0];
222 const NedPoint & b = path_[i0 + 1];
223 const float dx = b.x - a.x;
224 const float dy = b.y - a.y;
225 if (std::hypot(dx, dy) < 1e-3f)
226 {
227 return entryHeading_; // vertical segment: keep heading
228 }
229 return std::atan2(dy, dx);
230}

References entryHeading_, path_, cl_px4_mr::NedPoint::x, and cl_px4_mr::NedPoint::y.

Referenced by commandFor().

Here is the caller graph for this function:

◆ totalLength()

float cl_px4_mr::CbPx4PathFollowerBase::totalLength ( ) const
inlineprotected

Definition at line 113 of file cb_px4_path_follower_base.hpp.

113{ return totalLen_; }

References totalLen_.

◆ update()

void cl_px4_mr::CbPx4PathFollowerBase::update ( )
overridevirtual

Reimplemented from cl_px4_mr::CbPx4ClientBehaviorBase.

Definition at line 142 of file cb_px4_path_follower_base.cpp.

143{
145
146 if (!active_)
147 {
148 return;
149 }
150
151 const auto now = std::chrono::steady_clock::now();
152 float dt = std::chrono::duration<float>(now - lastUpdateTime_).count();
153 lastUpdateTime_ = now;
154 dt = std::clamp(dt, 0.0f, 0.5f);
155
156 if (!localPosition_->isValid())
157 {
158 // freeze the carrot; the watchdog covers a lost position
159 return;
160 }
161
162 NedPoint vehicle;
163 vehicle.x = localPosition_->getX();
164 vehicle.y = localPosition_->getY();
165 vehicle.z = localPosition_->getZ();
166
167 // advance the carrot, throttled by the leash (measured to the carrot as it
168 // will actually be commanded, centering offsets included)
169 const float sNext = std::min(sCarrot_ + followerParams_.groundSpeed * dt, totalLen_);
170 const NedPoint candidate = commandFor(sNext);
171 if (nedDistance(candidate, vehicle) <= followerParams_.leash)
172 {
173 sCarrot_ = sNext;
174 }
175
178
179 // vertex most recently passed by the carrot (cumLen_[0] == 0, so the
180 // upper_bound is never begin())
181 {
182 const size_t ub = std::upper_bound(cumLen_.begin(), cumLen_.end(), sCarrot_) - cumLen_.begin();
183 const size_t idx = ub == 0 ? 0 : ub - 1;
184 carrotVertex_ = path_.empty() ? 0 : std::min(idx, path_.size() - 1);
185 }
186
187 const int decile = static_cast<int>(progressFraction() * 10.0f);
188 if (decile != lastProgressDecile_ && decile > 0 && decile < 10)
189 {
190 lastProgressDecile_ = decile;
191 RCLCPP_INFO(
192 getLogger(), "%s: %d%% (%.0f / %.0f m)", behaviorName(), decile * 10, sCarrot_, totalLen_);
193 }
194
195 // completion: carrot at the end and vehicle within tolerance of the final
196 // commanded carrot (== the last vertex unless centering offsets it)
197 if (sCarrot_ >= totalLen_)
198 {
199 const NedPoint & end = lastCmd_;
200 const float dxy = nedDistanceXY(vehicle, end);
201 const float dz = std::fabs(vehicle.z - end.z);
203 {
204 active_ = false;
205 RCLCPP_INFO(
206 getLogger(), "%s: path complete (xy err %.2f m, z err %.2f m) - posting success",
207 behaviorName(), dxy, dz);
209 this->postPx4Success();
210 }
211 }
212}
float nedDistanceXY(const NedPoint &a, const NedPoint &b)

References active_, cl_px4_mr::PathFollowerParams::arrivalXyTol, cl_px4_mr::PathFollowerParams::arrivalZTol, behaviorName(), carrotVertex_, commandFor(), cumLen_, followerParams_, smacc2::ISmaccClientBehavior::getLogger(), cl_px4_mr::CpVehicleLocalPosition::getX(), cl_px4_mr::CpVehicleLocalPosition::getY(), cl_px4_mr::CpVehicleLocalPosition::getZ(), cl_px4_mr::PathFollowerParams::groundSpeed, cl_px4_mr::CpVehicleLocalPosition::isValid(), lastCmd_, lastProgressDecile_, lastUpdateTime_, cl_px4_mr::PathFollowerParams::leash, cl_px4_mr::CbPx4ClientBehaviorBase::localPosition_, cl_px4_mr::nedDistance(), cl_px4_mr::nedDistanceXY(), onPathCompleted(), path_, cl_px4_mr::CbPx4ClientBehaviorBase::postPx4Success(), progressFraction(), sCarrot_, cl_px4_mr::CpTrajectorySetpoint::setPositionNED(), totalLen_, cl_px4_mr::CbPx4ClientBehaviorBase::trajectorySetpoint_, cl_px4_mr::CbPx4ClientBehaviorBase::update(), cl_px4_mr::NedPoint::x, cl_px4_mr::NedPoint::y, cl_px4_mr::NedPoint::yaw, and cl_px4_mr::NedPoint::z.

Here is the call graph for this function:

Member Data Documentation

◆ active_

std::atomic<bool> cl_px4_mr::CbPx4PathFollowerBase::active_ {false}
private

Definition at line 137 of file cb_px4_path_follower_base.hpp.

137{false};

Referenced by onEntry(), onExit(), and update().

◆ carrotVertex_

std::atomic<size_t> cl_px4_mr::CbPx4PathFollowerBase::carrotVertex_ {0}
private

Definition at line 133 of file cb_px4_path_follower_base.hpp.

133{0};

Referenced by carrotVertexIndex(), onEntry(), and update().

◆ cumLen_

std::vector<float> cl_px4_mr::CbPx4PathFollowerBase::cumLen_
private

Definition at line 130 of file cb_px4_path_follower_base.hpp.

Referenced by commandFor(), onEntry(), and update().

◆ entryHeading_

float cl_px4_mr::CbPx4PathFollowerBase::entryHeading_ = 0.0f
private

Definition at line 134 of file cb_px4_path_follower_base.hpp.

Referenced by commandFor(), onEntry(), and tangentYawAt().

◆ followerParams_

◆ lastCmd_

NedPoint cl_px4_mr::CbPx4PathFollowerBase::lastCmd_
private

Definition at line 135 of file cb_px4_path_follower_base.hpp.

Referenced by onEntry(), onExit(), and update().

◆ lastProgressDecile_

int cl_px4_mr::CbPx4PathFollowerBase::lastProgressDecile_ = -1
private

Definition at line 136 of file cb_px4_path_follower_base.hpp.

Referenced by onEntry(), and update().

◆ lastUpdateTime_

std::chrono::steady_clock::time_point cl_px4_mr::CbPx4PathFollowerBase::lastUpdateTime_
private

Definition at line 138 of file cb_px4_path_follower_base.hpp.

Referenced by onEntry(), and update().

◆ path_

std::vector<NedPoint> cl_px4_mr::CbPx4PathFollowerBase::path_
private

Definition at line 129 of file cb_px4_path_follower_base.hpp.

Referenced by commandFor(), onEntry(), tangentYawAt(), and update().

◆ sCarrot_

float cl_px4_mr::CbPx4PathFollowerBase::sCarrot_ = 0.0f
private

Definition at line 132 of file cb_px4_path_follower_base.hpp.

Referenced by onEntry(), progressFraction(), and update().

◆ totalLen_

float cl_px4_mr::CbPx4PathFollowerBase::totalLen_ = 0.0f
private

Definition at line 131 of file cb_px4_path_follower_base.hpp.

Referenced by onEntry(), progressFraction(), totalLength(), and update().

◆ tunnelCentering_

CpTunnelCentering* cl_px4_mr::CbPx4PathFollowerBase::tunnelCentering_ = nullptr
protected

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