SMACC2
Loading...
Searching...
No Matches
cb_lemniscate.hpp
Go to the documentation of this file.
1// Copyright 2026 RobosoftAI Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
19
20namespace cl_px4_mr
21{
22
23// Figure eight (lemniscate of Bernoulli) about a point (default: the current
24// position) on the path follower: entered at the nearest point of the curve,
25// flown `count` times at the follower's ground speed, yaw along the path so a
26// forward camera films where the vehicle is going. Unlike CbFigureEight (which
27// streams setpoints with a fixed heading) it is leashed and terminates on
28// arrival at the last vertex.
30{
31public:
32 explicit CbLemniscate(
34 explicit CbLemniscate(int count, float size = 5.0f);
35
37 const FlightPatternFigureEightParams & params() const { return params_; }
38 void setCenter(float x, float y)
39 {
40 params_.centerX = x;
41 params_.centerY = y;
42 }
43
44protected:
45 std::vector<NedPoint> buildPath(const NedPoint & current) override;
46 const char * behaviorName() const override { return "CbLemniscate"; }
47
48private:
50};
51
52} // namespace cl_px4_mr
void setParams(const FlightPatternFigureEightParams &params)
const char * behaviorName() const override
void setCenter(float x, float y)
std::vector< NedPoint > buildPath(const NedPoint &current) override
CbLemniscate(FlightPatternFigureEightParams params={}, PathFollowerParams follower={})
FlightPatternFigureEightParams params_
const FlightPatternFigureEightParams & params() const