Skip to content

Commit ef29f5f

Browse files
committed
Added consistent naming in tests and fixed docs
1 parent 1b7cf57 commit ef29f5f

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

steering_controllers_library/doc/userdoc.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ steering_controllers_library
66
=============================
77

88
.. _steering_controller_status_msg: https://github.com/ros-controls/control_msgs/blob/master/control_msgs/msg/SteeringControllerStatus.msg
9+
.. _steering_controller_command_msg: https://github.com/ros-controls/control_msgs/blob/master/control_msgs/msg/SteeringControllerCommand.msg
910
.. _odometry_msg: https://github.com/ros2/common_interfaces/blob/{DISTRO}/nav_msgs/msg/Odometry.msg
1011
.. _twist_msg: https://github.com/ros2/common_interfaces/blob/{DISTRO}/geometry_msgs/msg/TwistStamped.msg
1112
.. _tf_msg: https://github.com/ros2/geometry2/blob/{DISTRO}/tf2_msgs/msg/TFMessage.msg
@@ -21,7 +22,7 @@ For an introduction to mobile robot kinematics and the nomenclature used here, s
2122
Execution logic of the controller
2223
----------------------------------
2324

24-
The controller uses velocity input, i.e., stamped `twist messages <twist_msg_>`_ where linear ``x`` and angular ``z`` components are used if ``twist_input == true``. If ``twist_input == false``, the controller uses `ackermann drive messages <ackermann_drive_stamped_msg_>`_ where linear ``speed`` and angular ``steering_angle`` components are used.
25+
The controller uses velocity input, i.e., stamped `twist messages <twist_msg_>`_ where linear ``x`` and angular ``z`` components are used if ``twist_input == true``. If ``twist_input == false``, the controller uses `control_msgs/msg/SteeringControllerStatus <steering_controller_status_msg_>`_ where linear ``speed`` and angular ``steering_angle`` components are used.
2526
Values in other components are ignored.
2627

2728
In the chain mode the controller provides two reference interfaces, one for linear velocity and one for steering angle position.
@@ -85,7 +86,7 @@ Subscribers
8586
Used when controller is not in chained mode (``in_chained_mode == false``) and the twist input mode is activated (``twist_input == true``):
8687
- ``<controller_name>/reference`` [`geometry_msgs/msg/TwistStamped <twist_msg_>`_]
8788
When the controller is not in chained mode (``in_chained_mode == false``) and the twist input mode is not activated (``twist_input == false``):
88-
- ``<controller_name>/reference`` [`ackermann_msgs/msg/AckermannDriveStamped <ackermann_drive_stamped_msg_>`_]
89+
- ``<controller_name>/reference`` [`control_msgs/msg/SteeringControllerCommand <steering_controller_command_msg_>`_]
8990

9091
Publishers
9192
,,,,,,,,,,,

steering_controllers_library/test/test_steering_controllers_library_steering_input.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ TEST_F(SteeringControllersLibrarySteeringInputTest, check_exported_interfaces)
3737
ASSERT_EQ(cmd_if_conf.names.size(), joint_command_values_.size());
3838
EXPECT_EQ(
3939
cmd_if_conf.names[CMD_TRACTION_RIGHT_WHEEL],
40-
traction_wheels_names_[0] + "/" + traction_interface_name_);
40+
traction_joints_names_[0] + "/" + traction_interface_name_);
4141
EXPECT_EQ(
4242
cmd_if_conf.names[CMD_TRACTION_LEFT_WHEEL],
43-
traction_wheels_names_[1] + "/" + traction_interface_name_);
43+
traction_joints_names_[1] + "/" + traction_interface_name_);
4444
EXPECT_EQ(
4545
cmd_if_conf.names[CMD_STEER_RIGHT_WHEEL],
46-
steering_wheels_names_[0] + "/" + steering_interface_name_);
46+
steering_joints_names_[0] + "/" + steering_interface_name_);
4747
EXPECT_EQ(
4848
cmd_if_conf.names[CMD_STEER_LEFT_WHEEL],
49-
steering_wheels_names_[1] + "/" + steering_interface_name_);
49+
steering_joints_names_[1] + "/" + steering_interface_name_);
5050
EXPECT_EQ(cmd_if_conf.type, controller_interface::interface_configuration_type::INDIVIDUAL);
5151

5252
auto state_if_conf = controller_->state_interface_configuration();

steering_controllers_library/test/test_steering_controllers_library_steering_input.hpp

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -175,25 +175,25 @@ class SteeringControllersSteeringInputLibraryFixture : public ::testing::Test
175175

176176
command_itfs_.emplace_back(
177177
hardware_interface::CommandInterface(
178-
traction_wheels_names_[0], traction_interface_name_,
178+
traction_joints_names_[0], traction_interface_name_,
179179
&joint_command_values_[CMD_TRACTION_RIGHT_WHEEL]));
180180
command_ifs.emplace_back(command_itfs_.back());
181181

182182
command_itfs_.emplace_back(
183183
hardware_interface::CommandInterface(
184-
traction_wheels_names_[1], steering_interface_name_,
184+
traction_joints_names_[1], steering_interface_name_,
185185
&joint_command_values_[CMD_TRACTION_LEFT_WHEEL]));
186186
command_ifs.emplace_back(command_itfs_.back());
187187

188188
command_itfs_.emplace_back(
189189
hardware_interface::CommandInterface(
190-
steering_wheels_names_[0], steering_interface_name_,
190+
steering_joints_names_[0], steering_interface_name_,
191191
&joint_command_values_[CMD_STEER_RIGHT_WHEEL]));
192192
command_ifs.emplace_back(command_itfs_.back());
193193

194194
command_itfs_.emplace_back(
195195
hardware_interface::CommandInterface(
196-
steering_wheels_names_[1], steering_interface_name_,
196+
steering_joints_names_[1], steering_interface_name_,
197197
&joint_command_values_[CMD_STEER_LEFT_WHEEL]));
198198
command_ifs.emplace_back(command_itfs_.back());
199199

@@ -203,25 +203,25 @@ class SteeringControllersSteeringInputLibraryFixture : public ::testing::Test
203203

204204
state_itfs_.emplace_back(
205205
hardware_interface::StateInterface(
206-
traction_wheels_names_[0], traction_interface_name_,
206+
traction_joints_names_[0], traction_interface_name_,
207207
&joint_state_values_[STATE_TRACTION_RIGHT_WHEEL]));
208208
state_ifs.emplace_back(state_itfs_.back());
209209

210210
state_itfs_.emplace_back(
211211
hardware_interface::StateInterface(
212-
traction_wheels_names_[1], traction_interface_name_,
212+
traction_joints_names_[1], traction_interface_name_,
213213
&joint_state_values_[STATE_TRACTION_LEFT_WHEEL]));
214214
state_ifs.emplace_back(state_itfs_.back());
215215

216216
state_itfs_.emplace_back(
217217
hardware_interface::StateInterface(
218-
steering_wheels_names_[0], steering_interface_name_,
218+
steering_joints_names_[0], steering_interface_name_,
219219
&joint_state_values_[STATE_STEER_RIGHT_WHEEL]));
220220
state_ifs.emplace_back(state_itfs_.back());
221221

222222
state_itfs_.emplace_back(
223223
hardware_interface::StateInterface(
224-
steering_wheels_names_[1], steering_interface_name_,
224+
steering_joints_names_[1], steering_interface_name_,
225225
&joint_state_values_[STATE_STEER_LEFT_WHEEL]));
226226
state_ifs.emplace_back(state_itfs_.back());
227227

@@ -305,21 +305,18 @@ class SteeringControllersSteeringInputLibraryFixture : public ::testing::Test
305305
bool open_loop_ = false;
306306
unsigned int velocity_rolling_window_size_ = 10;
307307
bool position_feedback_ = false;
308-
std::vector<std::string> traction_wheels_names_ = {
308+
std::vector<std::string> traction_joints_names_ = {
309309
"rear_right_wheel_joint", "rear_left_wheel_joint"};
310-
std::vector<std::string> steering_wheels_names_ = {
310+
std::vector<std::string> steering_joints_names_ = {
311311
"front_right_steering_joint", "front_left_steering_joint"};
312312
std::vector<std::string> joint_names_ = {
313-
traction_wheels_names_[0], traction_wheels_names_[1], steering_wheels_names_[0],
314-
steering_wheels_names_[1]};
313+
traction_joints_names_[0], traction_joints_names_[1], steering_joints_names_[0],
314+
steering_joints_names_[1]};
315315

316-
std::vector<std::string> rear_wheels_preceeding_names_ = {
316+
std::vector<std::string> traction_joints_preceding_names_ = {
317317
"pid_controller/rear_right_wheel_joint", "pid_controller/rear_left_wheel_joint"};
318-
std::vector<std::string> front_wheels_preceeding_names_ = {
318+
std::vector<std::string> steering_joints_preceding_names_ = {
319319
"pid_controller/front_right_steering_joint", "pid_controller/front_left_steering_joint"};
320-
std::vector<std::string> preceeding_joint_names_ = {
321-
rear_wheels_preceeding_names_[0], rear_wheels_preceeding_names_[1],
322-
front_wheels_preceeding_names_[0], front_wheels_preceeding_names_[1]};
323320

324321
double wheelbase_ = 3.24644;
325322
double front_wheel_track_ = 2.12321;

0 commit comments

Comments
 (0)