Skip to content

Commit bb27729

Browse files
committed
Fixed tests again
1 parent 976935a commit bb27729

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

steering_controllers_library/src/steering_odometry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ double SteeringOdometry::convert_twist_to_steering_angle(double v_bx, double ome
237237

238238
double SteeringOdometry::convert_steering_angle_to_angular_velocity(double v_bx, double phi)
239239
{
240-
return std::tan(phi) * v_bx / wheelbase_;
240+
return std::tan(phi) * v_bx / wheel_base_;
241241
}
242242

243243
std::tuple<std::vector<double>, std::vector<double>> SteeringOdometry::get_commands(
@@ -252,7 +252,7 @@ std::tuple<std::vector<double>, std::vector<double>> SteeringOdometry::get_comma
252252
{
253253
// TODO(anyone) this would be only possible if traction is on the steering axis
254254
phi = omega_bz > 0 ? M_PI_2 : -M_PI_2;
255-
Ws = abs(omega_bz) * wheelbase_ / wheel_radius_;
255+
Ws = abs(omega_bz) * wheel_base_ / wheel_radius_;
256256
}
257257
else
258258
{

steering_controllers_library/test/test_steering_controllers_library_ackermann.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ TEST_F(SteeringControllersLibraryTest, check_exported_interfaces)
5252
ASSERT_EQ(state_if_conf.names.size(), joint_state_values_.size());
5353
EXPECT_EQ(
5454
state_if_conf.names[STATE_TRACTION_RIGHT_WHEEL],
55-
controller_->rear_wheels_state_names_[0] + "/" + traction_interface_name_);
55+
controller_->traction_joints_state_names_[0] + "/" + traction_interface_name_);
5656
EXPECT_EQ(
5757
state_if_conf.names[STATE_TRACTION_LEFT_WHEEL],
58-
controller_->rear_wheels_state_names_[1] + "/" + traction_interface_name_);
58+
controller_->traction_joints_state_names_[1] + "/" + traction_interface_name_);
5959
EXPECT_EQ(
6060
state_if_conf.names[STATE_STEER_RIGHT_WHEEL],
61-
controller_->front_wheels_state_names_[0] + "/" + steering_interface_name_);
61+
controller_->steering_joints_state_names_[0] + "/" + steering_interface_name_);
6262
EXPECT_EQ(
6363
state_if_conf.names[STATE_STEER_LEFT_WHEEL],
64-
controller_->front_wheels_state_names_[1] + "/" + steering_interface_name_);
64+
controller_->steering_joints_state_names_[1] + "/" + steering_interface_name_);
6565
EXPECT_EQ(state_if_conf.type, controller_interface::interface_configuration_type::INDIVIDUAL);
6666

6767
// check ref itfs
@@ -150,12 +150,12 @@ TEST_F(SteeringControllersLibraryTest, test_both_update_methods_for_ref_timeout)
150150
}
151151

152152
// Wheel velocities should reset to 0
153-
EXPECT_EQ(controller_->command_interfaces_[0].get_value(), 0);
154-
EXPECT_EQ(controller_->command_interfaces_[1].get_value(), 0);
153+
EXPECT_EQ(controller_->command_interfaces_[0].get_optional().value(), 0);
154+
EXPECT_EQ(controller_->command_interfaces_[1].get_optional().value(), 0);
155155

156156
// Steer angles should not reset
157-
EXPECT_NEAR(controller_->command_interfaces_[2].get_value(), 0.575875, 1e-6);
158-
EXPECT_NEAR(controller_->command_interfaces_[3].get_value(), 0.575875, 1e-6);
157+
EXPECT_NEAR(controller_->command_interfaces_[2].get_optional().value(), 0.575875, 1e-6);
158+
EXPECT_NEAR(controller_->command_interfaces_[3].get_optional().value(), 0.575875, 1e-6);
159159

160160
// case 2 position_feedback = true
161161
controller_->params_.position_feedback = true;
@@ -197,12 +197,12 @@ TEST_F(SteeringControllersLibraryTest, test_both_update_methods_for_ref_timeout)
197197
}
198198

199199
// Wheel velocities should reset to 0
200-
EXPECT_EQ(controller_->command_interfaces_[0].get_value(), 0);
201-
EXPECT_EQ(controller_->command_interfaces_[1].get_value(), 0);
200+
EXPECT_EQ(controller_->command_interfaces_[0].get_optional().value(), 0);
201+
EXPECT_EQ(controller_->command_interfaces_[1].get_optional().value(), 0);
202202

203203
// Steer angles should not reset
204-
EXPECT_NEAR(controller_->command_interfaces_[2].get_value(), 0.575875, 1e-6);
205-
EXPECT_NEAR(controller_->command_interfaces_[3].get_value(), 0.575875, 1e-6);
204+
EXPECT_NEAR(controller_->command_interfaces_[2].get_optional().value(), 0.575875, 1e-6);
205+
EXPECT_NEAR(controller_->command_interfaces_[3].get_optional().value(), 0.575875, 1e-6);
206206
}
207207

208208
int main(int argc, char ** argv)

0 commit comments

Comments
 (0)