Skip to content

Commit

Permalink
update from suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 committed Nov 14, 2024
1 parent c6c9419 commit ed8093d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ class SteeringDynamics

private:
SteeringDynamicsState state_;
double inertia_{0.0};
double damping_{0.0};
double stiffness_{0.0};
double friction_{0.0};
double dead_zone_threshold_{0.0};
const double inertia_;
const double damping_;
const double stiffness_;
const double friction_;
const double dead_zone_threshold_;
};

struct StepResult
Expand Down Expand Up @@ -191,7 +191,7 @@ class MechanicalController
DelayBuffer delay_buffer_;
PIDController pid_;
SteeringDynamics steering_dynamics_;
MechanicalParams params_;
const MechanicalParams params_;

[[nodiscard]] StepResult run_one_step(
const double input_angle, const double speed, const double prev_input_angle, const double dt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ double MechanicalController::update_runge_kutta(
{
const auto dynamics_state = steering_dynamics_.get_state();

// NOTE: k1, k2, k3, k4 suffix denote the intermediate points of RK4
const auto k1 =
run_one_step(input_angle, speed, prev_input_angle, dt, delay_buffer_, pid_, steering_dynamics_);

Expand Down

0 comments on commit ed8093d

Please sign in to comment.