Skip to content

Commit 9e738c4

Browse files
tobifalkcassava
authored andcommitted
models: Allow overriding of actuation methods
1 parent 9e9169e commit 9e738c4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

models/include/cloe/component/latlong_actuator.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,35 @@ class LatLongActuator : public Component {
4545
* Set the vehicle target acceleration in m/s^2.
4646
* The time that the vehicle requires to reach this acceleration is undefined.
4747
*/
48-
void set_acceleration(double a) {
48+
virtual void set_acceleration(double a) {
4949
target_acceleration_ = a;
5050
level_.set_long();
5151
}
5252

53-
boost::optional<double> acceleration() const { return target_acceleration_; }
53+
virtual boost::optional<double> acceleration() { return target_acceleration_; }
5454

5555
/**
5656
* Return true if set_acceleration was called for the current step.
5757
*/
58-
bool is_acceleration() const { return static_cast<bool>(target_acceleration_); }
58+
virtual bool is_acceleration() const { return static_cast<bool>(target_acceleration_); }
5959

6060
/**
6161
* Set the target steering angle of the wheels in rad.
6262
* The time that the vehicle requires to reach this steering angle is undefined.
6363
* In most cases, the front left wheel defines the angle, and the time to target
6464
* steering angle is zero.
6565
*/
66-
void set_steering_angle(double a) {
66+
virtual void set_steering_angle(double a) {
6767
target_steering_angle_ = a;
6868
level_.set_lat();
6969
}
7070

71-
boost::optional<double> steering_angle() const { return target_steering_angle_; }
71+
virtual boost::optional<double> steering_angle() { return target_steering_angle_; }
7272

7373
/**
7474
* Return true if set_target_steering_angle was called for the current step.
7575
*/
76-
bool is_steering_angle() const { return static_cast<bool>(target_steering_angle_); }
76+
virtual bool is_steering_angle() const { return static_cast<bool>(target_steering_angle_); }
7777

7878
/**
7979
* Return a single enum summarizing the current actuation level of control.

0 commit comments

Comments
 (0)