Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steering controllers library: fix open loop mode (backport #793) #800

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ class SteeringOdometry
* \param theta_dot Desired angular velocity [rad/s]
* \return Tuple of velocity commands and steering commands
*/
std::tuple<std::vector<double>, std::vector<double>> get_commands(double Vx, double theta_dot);
std::tuple<std::vector<double>, std::vector<double>> get_commands(
const double Vx, const double theta_dot);

/**
* \brief Reset poses, heading, and accumulators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,11 @@ controller_interface::return_type SteeringControllersLibrary::update_and_write_c
if (!std::isnan(reference_interfaces_[0]) && !std::isnan(reference_interfaces_[1]))
{
// store and set commands
const double linear_command = reference_interfaces_[0];
const double angular_command = reference_interfaces_[1];
last_linear_velocity_ = reference_interfaces_[0];
last_angular_velocity_ = reference_interfaces_[1];

auto [traction_commands, steering_commands] =
odometry_.get_commands(linear_command, angular_command);
odometry_.get_commands(last_linear_velocity_, last_angular_velocity_);
if (params_.front_steering)
{
for (size_t i = 0; i < params_.rear_wheels_names.size(); i++)
Expand Down
2 changes: 1 addition & 1 deletion steering_controllers_library/src/steering_odometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ double SteeringOdometry::convert_trans_rot_vel_to_steering_angle(double Vx, doub
}

std::tuple<std::vector<double>, std::vector<double>> SteeringOdometry::get_commands(
double Vx, double theta_dot)
const double Vx, const double theta_dot)
{
// desired velocity and steering angle of the middle of traction and steering axis
double Ws, alpha;
Expand Down
Loading