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

[JTC] Fix typos, implicit cast, const member functions (backport #748) #749

Closed
wants to merge 1 commit into from
Closed
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 @@ -252,6 +252,12 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa
JOINT_TRAJECTORY_CONTROLLER_PUBLIC
bool reset();

<<<<<<< HEAD
=======
JOINT_TRAJECTORY_CONTROLLER_PUBLIC
bool has_active_trajectory() const;

>>>>>>> 6b73cf5 ([JTC] Fix typos, implicit cast, const member functions (#748))
using JointTrajectoryPoint = trajectory_msgs::msg::JointTrajectoryPoint;
JOINT_TRAJECTORY_CONTROLLER_PUBLIC
void publish_state(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,14 @@ void JointTrajectoryController::resize_joint_trajectory_point_command(
}
}

<<<<<<< HEAD
=======
bool JointTrajectoryController::has_active_trajectory() const
{
return traj_external_point_ptr_ != nullptr && traj_external_point_ptr_->has_trajectory_msg();
}

>>>>>>> 6b73cf5 ([JTC] Fix typos, implicit cast, const member functions (#748))
} // namespace joint_trajectory_controller

#include "pluginlib/class_list_macros.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ joint_trajectory_controller:
i: {
type: double,
default_value: 0.0,
description: "Intigral gain for PID"
description: "Integral gain for PID"
}
d: {
type: double,
Expand All @@ -99,7 +99,7 @@ joint_trajectory_controller:
i_clamp: {
type: double,
default_value: 0.0,
description: "Integrale clamp. Symmetrical in both positive and negative direction."
description: "Integral clamp. Symmetrical in both positive and negative direction."
}
ff_velocity_scale: {
type: double,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1598,9 +1598,9 @@ TEST_P(TrajectoryControllerTestParameterized, test_hw_states_has_offset_later_co
// set command values to NaN
for (size_t i = 0; i < 3; ++i)
{
joint_pos_[i] = 3.1 + i;
joint_vel_[i] = 0.25 + i;
joint_acc_[i] = 0.02 + i / 10.0;
joint_pos_[i] = 3.1 + static_cast<double>(i);
joint_vel_[i] = 0.25 + static_cast<double>(i);
joint_acc_[i] = 0.02 + static_cast<double>(i) / 10.0;
}
SetUpAndActivateTrajectoryController(executor, true, {is_open_loop_parameters}, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,28 +101,38 @@ class TestableJointTrajectoryController

void trigger_declare_parameters() { param_listener_->declare_params(); }

trajectory_msgs::msg::JointTrajectoryPoint get_current_state_when_offset()
trajectory_msgs::msg::JointTrajectoryPoint get_current_state_when_offset() const
{
return last_commanded_state_;
}
bool has_position_state_interface() { return has_position_state_interface_; }
bool has_position_state_interface() const { return has_position_state_interface_; }

bool has_velocity_state_interface() { return has_velocity_state_interface_; }
bool has_velocity_state_interface() const { return has_velocity_state_interface_; }

bool has_acceleration_state_interface() { return has_acceleration_state_interface_; }
bool has_acceleration_state_interface() const { return has_acceleration_state_interface_; }

bool has_position_command_interface() { return has_position_command_interface_; }
bool has_position_command_interface() const { return has_position_command_interface_; }

bool has_velocity_command_interface() { return has_velocity_command_interface_; }
bool has_velocity_command_interface() const { return has_velocity_command_interface_; }

bool has_acceleration_command_interface() { return has_acceleration_command_interface_; }
bool has_acceleration_command_interface() const { return has_acceleration_command_interface_; }

bool has_effort_command_interface() { return has_effort_command_interface_; }
bool has_effort_command_interface() const { return has_effort_command_interface_; }

bool use_closed_loop_pid_adapter() { return use_closed_loop_pid_adapter_; }
bool use_closed_loop_pid_adapter() const { return use_closed_loop_pid_adapter_; }

bool is_open_loop() { return params_.open_loop_control; }
bool is_open_loop() const { return params_.open_loop_control; }

<<<<<<< HEAD
=======
bool has_active_traj() const { return has_active_trajectory(); }

bool has_trivial_traj() const
{
return has_active_trajectory() && traj_external_point_ptr_->has_nontrivial_msg() == false;
}

>>>>>>> 6b73cf5 ([JTC] Fix typos, implicit cast, const member functions (#748))
rclcpp::WaitSet joint_cmd_sub_wait_set_;
};

Expand Down