20class SetpointBase :
public std::enable_shared_from_this<SetpointBase> {
22 using ShouldActivateCB = std::function<void()>;
23 using SetpointType =
decltype(px4_msgs::msg::SetpointConfig::type);
29 std::shared_ptr<SetpointBase> getSharedPtr()
32 return shared_from_this();
33 }
catch (
const std::bad_weak_ptr& exception) {
34 throw Exception(
"Setpoint must be instantiated with std::make_shared<>");
55 virtual float desiredUpdateRateHz() {
return 50.f; }
57 void setShouldActivateCallback(
const ShouldActivateCB& should_activate_cb)
59 _should_activate_cb = should_activate_cb;
61 void setActive(
bool active) { _active = active; }
66 if (!_active && _should_activate_cb) {
67 _should_activate_cb();
72 ShouldActivateCB _should_activate_cb;
Definition context.hpp:18