Skip to content

Commit

Permalink
Added -Wconversion flag and fix warnings (#667)
Browse files Browse the repository at this point in the history
(cherry picked from commit 23f0def)

# Conflicts:
#	diff_drive_controller/src/diff_drive_controller.cpp
#	joint_trajectory_controller/src/joint_trajectory_controller.cpp
#	tricycle_controller/src/tricycle_controller.cpp
  • Loading branch information
gwalck authored and mergify[bot] committed Oct 26, 2024
1 parent e3c21e5 commit 131b9c5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
5 changes: 5 additions & 0 deletions diff_drive_controller/src/diff_drive_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,13 @@ controller_interface::return_type DiffDriveController::update(
left_feedback_mean += left_feedback;
right_feedback_mean += right_feedback;
}
<<<<<<< HEAD
left_feedback_mean /= static_cast<double>(wheels_per_side_);
right_feedback_mean /= static_cast<double>(wheels_per_side_);
=======
left_feedback_mean /= static_cast<double>(params_.wheels_per_side);
right_feedback_mean /= static_cast<double>(params_.wheels_per_side);
>>>>>>> 23f0def (Added -Wconversion flag and fix warnings (#667))

if (params_.position_feedback)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,17 @@ controller_interface::return_type JointTrajectoryController::update(
{
return controller_interface::return_type::OK;
}
<<<<<<< HEAD
auto logger = this->get_node()->get_logger();
// update dynamic parameters
if (param_listener_->is_old(params_))
=======

auto compute_error_for_joint = [&](
JointTrajectoryPoint & error, size_t index,
const JointTrajectoryPoint & current,
const JointTrajectoryPoint & desired)
>>>>>>> 23f0def (Added -Wconversion flag and fix warnings (#667))
{
params_ = param_listener_->get_params();
default_tolerances_ = get_segment_tolerances(logger, params_);
Expand Down
38 changes: 38 additions & 0 deletions tricycle_controller/src/tricycle_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,47 @@ CallbackReturn TricycleController::on_init()
{
try
{
<<<<<<< HEAD
// Create the parameter listener and get the parameters
param_listener_ = std::make_shared<ParamListener>(get_node());
params_ = param_listener_->get_params();
=======
// with the lifecycle node being initialized, we can declare parameters
auto_declare<std::string>("traction_joint_name", std::string());
auto_declare<std::string>("steering_joint_name", std::string());

auto_declare<double>("wheelbase", wheel_params_.wheelbase);
auto_declare<double>("wheel_radius", wheel_params_.radius);

auto_declare<std::string>("odom_frame_id", odom_params_.odom_frame_id);
auto_declare<std::string>("base_frame_id", odom_params_.base_frame_id);
auto_declare<std::vector<double>>("pose_covariance_diagonal", std::vector<double>());
auto_declare<std::vector<double>>("twist_covariance_diagonal", std::vector<double>());
auto_declare<bool>("open_loop", odom_params_.open_loop);
auto_declare<bool>("enable_odom_tf", odom_params_.enable_odom_tf);
auto_declare<bool>("odom_only_twist", odom_params_.odom_only_twist);

auto_declare<int>("cmd_vel_timeout", static_cast<int>(cmd_vel_timeout_.count()));
auto_declare<bool>("publish_ackermann_command", publish_ackermann_command_);
auto_declare<int>("velocity_rolling_window_size", 10);
auto_declare<bool>("use_stamped_vel", use_stamped_vel_);

auto_declare<double>("traction.max_velocity", NAN);
auto_declare<double>("traction.min_velocity", NAN);
auto_declare<double>("traction.max_acceleration", NAN);
auto_declare<double>("traction.min_acceleration", NAN);
auto_declare<double>("traction.max_deceleration", NAN);
auto_declare<double>("traction.min_deceleration", NAN);
auto_declare<double>("traction.max_jerk", NAN);
auto_declare<double>("traction.min_jerk", NAN);

auto_declare<double>("steering.max_position", NAN);
auto_declare<double>("steering.min_position", NAN);
auto_declare<double>("steering.max_velocity", NAN);
auto_declare<double>("steering.min_velocity", NAN);
auto_declare<double>("steering.max_acceleration", NAN);
auto_declare<double>("steering.min_acceleration", NAN);
>>>>>>> 23f0def (Added -Wconversion flag and fix warnings (#667))
}
catch (const std::exception & e)
{
Expand Down

0 comments on commit 131b9c5

Please sign in to comment.