SMACC2
Loading...
Searching...
No Matches
cb_ascend_to_altitude.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/*****************************************************************************************************************
16 *
17 * Authors: Brett Aldrich
18 *
19 ******************************************************************************************************************/
20
21#pragma once
22
25
26namespace cl_px4_mr
27{
28
29// Rate-controlled climb (or descent) to an altitude at the current XY (or a
30// target XY, for a precise pre-landing descent), heading held. Succeeds immediately if already within tolerance. Unlike
31// CbChangeAltitude (single setpoint step + goal checker) the setpoint climbs
32// at `climbRate` and stays leashed to the vehicle.
34{
35public:
36 explicit CbAscendToAltitude(
38 explicit CbAscendToAltitude(float altitudeAgl, float climbRate = 1.5f);
39
41 void setTargetXy(float x, float y)
42 {
43 params_.targetX = x;
44 params_.targetY = y;
45 }
46 const FlightPatternAscendParams & params() const { return params_; }
47
48protected:
49 std::vector<NedPoint> buildPath(const NedPoint & current) override;
50 const char * behaviorName() const override { return "CbAscendToAltitude"; }
51
52private:
54};
55
56} // namespace cl_px4_mr
void setParams(const FlightPatternAscendParams &params)
CbAscendToAltitude(FlightPatternAscendParams params={}, PathFollowerParams follower={})
std::vector< NedPoint > buildPath(const NedPoint &current) override
FlightPatternAscendParams params_
const char * behaviorName() const override
const FlightPatternAscendParams & params() const