Skip to content

Commit 64adf67

Browse files
Remove unstamped twist subscribers + parameters (#1151)
1 parent 9625702 commit 64adf67

18 files changed

+20
-127
lines changed

ackermann_steering_controller/test/ackermann_steering_controller_params.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ test_ackermann_steering_controller:
66
open_loop: false
77
velocity_rolling_window_size: 10
88
position_feedback: false
9-
use_stamped_vel: true
109
rear_wheels_names: [rear_right_wheel_joint, rear_left_wheel_joint]
1110
front_wheels_names: [front_right_steering_joint, front_left_steering_joint]
1211

ackermann_steering_controller/test/ackermann_steering_controller_preceeding_params.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ test_ackermann_steering_controller:
55
open_loop: false
66
velocity_rolling_window_size: 10
77
position_feedback: false
8-
use_stamped_vel: true
98
rear_wheels_names: [pid_controller/rear_right_wheel_joint, pid_controller/rear_left_wheel_joint]
109
front_wheels_names: [pid_controller/front_right_steering_joint, pid_controller/front_left_steering_joint]
1110
rear_wheels_state_names: [rear_right_wheel_joint, rear_left_wheel_joint]

ackermann_steering_controller/test/test_ackermann_steering_controller.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ class AckermannSteeringControllerFixture : public ::testing::Test
280280
bool open_loop_ = false;
281281
unsigned int velocity_rolling_window_size_ = 10;
282282
bool position_feedback_ = false;
283-
bool use_stamped_vel_ = true;
284283
std::vector<std::string> rear_wheels_names_ = {"rear_right_wheel_joint", "rear_left_wheel_joint"};
285284
std::vector<std::string> front_wheels_names_ = {
286285
"front_right_steering_joint", "front_left_steering_joint"};

bicycle_steering_controller/test/bicycle_steering_controller_params.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ test_bicycle_steering_controller:
66
open_loop: false
77
velocity_rolling_window_size: 10
88
position_feedback: false
9-
use_stamped_vel: true
109
rear_wheels_names: [rear_wheel_joint]
1110
front_wheels_names: [steering_axis_joint]
1211

bicycle_steering_controller/test/bicycle_steering_controller_preceeding_params.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ test_bicycle_steering_controller:
55
open_loop: false
66
velocity_rolling_window_size: 10
77
position_feedback: false
8-
use_stamped_vel: true
98
rear_wheels_names: [pid_controller/rear_wheel_joint]
109
front_wheels_names: [pid_controller/steering_axis_joint]
1110
rear_wheels_state_names: [rear_wheel_joint]

bicycle_steering_controller/test/test_bicycle_steering_controller.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ class BicycleSteeringControllerFixture : public ::testing::Test
251251
bool open_loop_ = false;
252252
unsigned int velocity_rolling_window_size_ = 10;
253253
bool position_feedback_ = false;
254-
bool use_stamped_vel_ = true;
255254
std::vector<std::string> rear_wheels_names_ = {"rear_wheel_joint"};
256255
std::vector<std::string> front_wheels_names_ = {"steering_axis_joint"};
257256
std::vector<std::string> joint_names_ = {rear_wheels_names_[0], front_wheels_names_[0]};

steering_controllers_library/include/steering_controllers_library/steering_controllers_library.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class SteeringControllersLibrary : public controller_interface::ChainableControl
9898
// Command subscribers and Controller State publisher
9999
rclcpp::Subscription<ControllerTwistReferenceMsg>::SharedPtr ref_subscriber_twist_ = nullptr;
100100
rclcpp::Subscription<ControllerTwistReferenceMsg>::SharedPtr ref_subscriber_ackermann_ = nullptr;
101-
rclcpp::Subscription<geometry_msgs::msg::Twist>::SharedPtr ref_subscriber_unstamped_ = nullptr;
102101
realtime_tools::RealtimeBuffer<std::shared_ptr<ControllerTwistReferenceMsg>> input_ref_;
103102
rclcpp::Duration ref_timeout_ = rclcpp::Duration::from_seconds(0.0); // 0ms
104103

@@ -143,7 +142,6 @@ class SteeringControllersLibrary : public controller_interface::ChainableControl
143142
// callback for topic interface
144143
STEERING_CONTROLLERS__VISIBILITY_LOCAL void reference_callback(
145144
const std::shared_ptr<ControllerTwistReferenceMsg> msg);
146-
void reference_callback_unstamped(const std::shared_ptr<geometry_msgs::msg::Twist> msg);
147145
};
148146

149147
} // namespace steering_controllers_library

steering_controllers_library/src/steering_controllers_library.cpp

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,9 @@ controller_interface::CallbackReturn SteeringControllersLibrary::on_configure(
114114

115115
// Reference Subscriber
116116
ref_timeout_ = rclcpp::Duration::from_seconds(params_.reference_timeout);
117-
if (params_.use_stamped_vel)
118-
{
119-
RCLCPP_WARN(
120-
get_node()->get_logger(),
121-
"[Deprecated] Using geometry_msgs::msg::Twist instead of TwistStamped is deprecated.");
122-
ref_subscriber_twist_ = get_node()->create_subscription<ControllerTwistReferenceMsg>(
123-
"~/reference", subscribers_qos,
124-
std::bind(&SteeringControllersLibrary::reference_callback, this, std::placeholders::_1));
125-
}
126-
else
127-
{
128-
ref_subscriber_unstamped_ = get_node()->create_subscription<geometry_msgs::msg::Twist>(
129-
"~/reference_unstamped", subscribers_qos,
130-
std::bind(
131-
&SteeringControllersLibrary::reference_callback_unstamped, this, std::placeholders::_1));
132-
}
117+
ref_subscriber_twist_ = get_node()->create_subscription<ControllerTwistReferenceMsg>(
118+
"~/reference", subscribers_qos,
119+
std::bind(&SteeringControllersLibrary::reference_callback, this, std::placeholders::_1));
133120

134121
std::shared_ptr<ControllerTwistReferenceMsg> msg =
135122
std::make_shared<ControllerTwistReferenceMsg>();
@@ -244,42 +231,6 @@ void SteeringControllersLibrary::reference_callback(
244231
}
245232
}
246233

247-
void SteeringControllersLibrary::reference_callback_unstamped(
248-
const std::shared_ptr<geometry_msgs::msg::Twist> msg)
249-
{
250-
RCLCPP_WARN(
251-
get_node()->get_logger(),
252-
"Use of Twist message without stamped is deprecated and it will be removed in ROS 2 J-Turtle "
253-
"version. Use '~/reference' topic with 'geometry_msgs::msg::TwistStamped' message type in the "
254-
"future.");
255-
auto twist_stamped = *(input_ref_.readFromNonRT());
256-
twist_stamped->header.stamp = get_node()->now();
257-
// if no timestamp provided use current time for command timestamp
258-
if (twist_stamped->header.stamp.sec == 0 && twist_stamped->header.stamp.nanosec == 0u)
259-
{
260-
RCLCPP_WARN(
261-
get_node()->get_logger(),
262-
"Timestamp in header is missing, using current time as command timestamp.");
263-
twist_stamped->header.stamp = get_node()->now();
264-
}
265-
266-
const auto age_of_last_command = get_node()->now() - twist_stamped->header.stamp;
267-
268-
if (ref_timeout_ == rclcpp::Duration::from_seconds(0) || age_of_last_command <= ref_timeout_)
269-
{
270-
twist_stamped->twist = *msg;
271-
}
272-
else
273-
{
274-
RCLCPP_ERROR(
275-
get_node()->get_logger(),
276-
"Received message has timestamp %.10f older for %.10f which is more then allowed timeout "
277-
"(%.4f).",
278-
rclcpp::Time(twist_stamped->header.stamp).seconds(), age_of_last_command.seconds(),
279-
ref_timeout_.seconds());
280-
}
281-
}
282-
283234
controller_interface::InterfaceConfiguration
284235
SteeringControllersLibrary::command_interface_configuration() const
285236
{

steering_controllers_library/src/steering_controllers_library.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,3 @@ steering_controllers_library:
112112
position_feedback is true then ``HW_IF_POSITION`` is taken as interface type",
113113
read_only: false,
114114
}
115-
116-
use_stamped_vel: {
117-
type: bool,
118-
default_value: false,
119-
description: "(Deprecated) Choice of vel type, if use_stamped_vel is false then ``geometry_msgs::msg::Twist`` is taken as vel msg type, if
120-
use_stamped_vel is true then ``geometry_msgs::msg::TwistStamped`` is taken as vel msg type",
121-
read_only: false,
122-
}

steering_controllers_library/test/steering_controllers_library_params.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ test_steering_controllers_library:
66
open_loop: false
77
velocity_rolling_window_size: 10
88
position_feedback: false
9-
use_stamped_vel: true
109
rear_wheels_names: [rear_right_wheel_joint, rear_left_wheel_joint]
1110
front_wheels_names: [front_right_steering_joint, front_left_steering_joint]
1211

0 commit comments

Comments
 (0)