@@ -138,11 +138,9 @@ TEST_P(TrajectoryControllerTestParameterized, check_interface_names)
138
138
TEST_P (TrajectoryControllerTestParameterized, check_interface_names_with_command_joints)
139
139
{
140
140
rclcpp::executors::MultiThreadedExecutor executor;
141
- SetUpTrajectoryController (executor);
142
-
143
141
// set command_joints parameter
144
142
const rclcpp::Parameter command_joint_names_param (" command_joints" , command_joint_names_);
145
- traj_controller_-> get_node ()-> set_parameter ( {command_joint_names_param});
143
+ SetUpTrajectoryController (executor, {command_joint_names_param});
146
144
147
145
const auto state = traj_controller_->get_node ()->configure ();
148
146
ASSERT_EQ (state.id (), State::PRIMARY_STATE_INACTIVE);
@@ -206,7 +204,7 @@ TEST_P(TrajectoryControllerTestParameterized, cleanup)
206
204
rclcpp::executors::MultiThreadedExecutor executor;
207
205
std::vector<rclcpp::Parameter> params = {
208
206
rclcpp::Parameter (" allow_nonzero_velocity_at_trajectory_end" , true )};
209
- SetUpAndActivateTrajectoryController (executor, true , params);
207
+ SetUpAndActivateTrajectoryController (executor, params);
210
208
211
209
// send msg
212
210
constexpr auto FIRST_POINT_TIME = std::chrono::milliseconds (250 );
@@ -252,12 +250,11 @@ TEST_P(TrajectoryControllerTestParameterized, cleanup_after_configure)
252
250
TEST_P (TrajectoryControllerTestParameterized, correct_initialization_using_parameters)
253
251
{
254
252
rclcpp::executors::MultiThreadedExecutor executor;
255
- SetUpTrajectoryController (executor, false );
253
+ SetUpTrajectoryController (executor);
256
254
traj_controller_->get_node ()->set_parameter (
257
255
rclcpp::Parameter (" allow_nonzero_velocity_at_trajectory_end" , true ));
258
256
259
257
// This call is replacing the way parameters are set via launch
260
- SetParameters ();
261
258
traj_controller_->configure ();
262
259
auto state = traj_controller_->get_state ();
263
260
ASSERT_EQ (State::PRIMARY_STATE_INACTIVE, state.id ());
@@ -324,7 +321,7 @@ TEST_P(TrajectoryControllerTestParameterized, correct_initialization_using_param
324
321
TEST_P (TrajectoryControllerTestParameterized, state_topic_legacy_consistency)
325
322
{
326
323
rclcpp::executors::SingleThreadedExecutor executor;
327
- SetUpAndActivateTrajectoryController (executor, true , {});
324
+ SetUpAndActivateTrajectoryController (executor, {});
328
325
subscribeToStateLegacy ();
329
326
updateController ();
330
327
@@ -376,7 +373,7 @@ TEST_P(TrajectoryControllerTestParameterized, state_topic_legacy_consistency)
376
373
TEST_P (TrajectoryControllerTestParameterized, state_topic_consistency)
377
374
{
378
375
rclcpp::executors::SingleThreadedExecutor executor;
379
- SetUpAndActivateTrajectoryController (executor, true , {});
376
+ SetUpAndActivateTrajectoryController (executor, {});
380
377
subscribeToState ();
381
378
updateController ();
382
379
@@ -478,7 +475,7 @@ TEST_P(TrajectoryControllerTestParameterized, no_hold_on_startup)
478
475
rclcpp::executors::MultiThreadedExecutor executor;
479
476
480
477
rclcpp::Parameter start_with_holding_parameter (" start_with_holding" , false );
481
- SetUpAndActivateTrajectoryController (executor, true , {start_with_holding_parameter});
478
+ SetUpAndActivateTrajectoryController (executor, {start_with_holding_parameter});
482
479
483
480
constexpr auto FIRST_POINT_TIME = std::chrono::milliseconds (250 );
484
481
updateController (rclcpp::Duration (FIRST_POINT_TIME));
@@ -496,7 +493,7 @@ TEST_P(TrajectoryControllerTestParameterized, hold_on_startup)
496
493
rclcpp::executors::MultiThreadedExecutor executor;
497
494
498
495
rclcpp::Parameter start_with_holding_parameter (" start_with_holding" , true );
499
- SetUpAndActivateTrajectoryController (executor, true , {start_with_holding_parameter});
496
+ SetUpAndActivateTrajectoryController (executor, {start_with_holding_parameter});
500
497
501
498
constexpr auto FIRST_POINT_TIME = std::chrono::milliseconds (250 );
502
499
updateController (rclcpp::Duration (FIRST_POINT_TIME));
@@ -520,7 +517,7 @@ TEST_P(TrajectoryControllerTestParameterized, position_error_not_normalized)
520
517
constexpr double k_p = 10.0 ;
521
518
std::vector<rclcpp::Parameter> params = {
522
519
rclcpp::Parameter (" allow_nonzero_velocity_at_trajectory_end" , true )};
523
- SetUpAndActivateTrajectoryController (executor, true , params, true , k_p, 0.0 , false );
520
+ SetUpAndActivateTrajectoryController (executor, params, true , k_p, 0.0 , false );
524
521
subscribeToState ();
525
522
526
523
size_t n_joints = joint_names_.size ();
@@ -629,7 +626,7 @@ TEST_P(TrajectoryControllerTestParameterized, position_error_normalized)
629
626
constexpr double k_p = 10.0 ;
630
627
std::vector<rclcpp::Parameter> params = {
631
628
rclcpp::Parameter (" allow_nonzero_velocity_at_trajectory_end" , true )};
632
- SetUpAndActivateTrajectoryController (executor, true , params, true , k_p, 0.0 , true );
629
+ SetUpAndActivateTrajectoryController (executor, params, true , k_p, 0.0 , true );
633
630
subscribeToState ();
634
631
635
632
size_t n_joints = joint_names_.size ();
@@ -750,7 +747,7 @@ void TrajectoryControllerTest::test_state_publish_rate_target(int target_msg_cou
750
747
rclcpp::Parameter state_publish_rate_param (
751
748
" state_publish_rate" , static_cast <double >(target_msg_count));
752
749
rclcpp::executors::SingleThreadedExecutor executor;
753
- SetUpAndActivateTrajectoryController (executor, true , {state_publish_rate_param});
750
+ SetUpAndActivateTrajectoryController (executor, {state_publish_rate_param});
754
751
755
752
auto future_handle = std::async (std::launch::async, [&executor]() -> void { executor.spin (); });
756
753
@@ -819,7 +816,7 @@ TEST_P(TrajectoryControllerTestParameterized, use_closed_loop_pid)
819
816
TEST_P (TrajectoryControllerTestParameterized, velocity_error)
820
817
{
821
818
rclcpp::executors::MultiThreadedExecutor executor;
822
- SetUpAndActivateTrajectoryController (executor, true , {}, true );
819
+ SetUpAndActivateTrajectoryController (executor, {}, true );
823
820
subscribeToState ();
824
821
825
822
size_t n_joints = joint_names_.size ();
@@ -945,7 +942,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_partial_joint_list)
945
942
rclcpp::Parameter partial_joints_parameters (" allow_partial_joints_goal" , true );
946
943
947
944
rclcpp::executors::SingleThreadedExecutor executor;
948
- SetUpAndActivateTrajectoryController (executor, true , {partial_joints_parameters});
945
+ SetUpAndActivateTrajectoryController (executor, {partial_joints_parameters});
949
946
950
947
const double initial_joint1_cmd = joint_pos_[0 ];
951
948
const double initial_joint2_cmd = joint_pos_[1 ];
@@ -1017,7 +1014,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_partial_joint_list_not_allowe
1017
1014
rclcpp::Parameter partial_joints_parameters (" allow_partial_joints_goal" , false );
1018
1015
1019
1016
rclcpp::executors::SingleThreadedExecutor executor;
1020
- SetUpAndActivateTrajectoryController (executor, true , {partial_joints_parameters});
1017
+ SetUpAndActivateTrajectoryController (executor, {partial_joints_parameters});
1021
1018
1022
1019
const double initial_joint1_cmd = joint_pos_[0 ];
1023
1020
const double initial_joint2_cmd = joint_pos_[1 ];
@@ -1099,7 +1096,7 @@ TEST_P(TrajectoryControllerTestParameterized, invalid_message)
1099
1096
rclcpp::Parameter allow_integration_parameters (" allow_integration_in_goal_trajectories" , false );
1100
1097
rclcpp::executors::SingleThreadedExecutor executor;
1101
1098
SetUpAndActivateTrajectoryController (
1102
- executor, true , {partial_joints_parameters, allow_integration_parameters});
1099
+ executor, {partial_joints_parameters, allow_integration_parameters});
1103
1100
1104
1101
trajectory_msgs::msg::JointTrajectory traj_msg, good_traj_msg;
1105
1102
@@ -1160,7 +1157,7 @@ TEST_P(TrajectoryControllerTestParameterized, missing_positions_message_accepted
1160
1157
{
1161
1158
rclcpp::Parameter allow_integration_parameters (" allow_integration_in_goal_trajectories" , true );
1162
1159
rclcpp::executors::SingleThreadedExecutor executor;
1163
- SetUpAndActivateTrajectoryController (executor, true , {allow_integration_parameters});
1160
+ SetUpAndActivateTrajectoryController (executor, {allow_integration_parameters});
1164
1161
1165
1162
trajectory_msgs::msg::JointTrajectory traj_msg, good_traj_msg;
1166
1163
@@ -1222,7 +1219,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_trajectory_replace)
1222
1219
{
1223
1220
rclcpp::executors::SingleThreadedExecutor executor;
1224
1221
rclcpp::Parameter partial_joints_parameters (" allow_partial_joints_goal" , true );
1225
- SetUpAndActivateTrajectoryController (executor, true , {partial_joints_parameters});
1222
+ SetUpAndActivateTrajectoryController (executor, {partial_joints_parameters});
1226
1223
1227
1224
subscribeToState ();
1228
1225
@@ -1265,7 +1262,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_trajectory_replace)
1265
1262
TEST_P (TrajectoryControllerTestParameterized, test_ignore_old_trajectory)
1266
1263
{
1267
1264
rclcpp::executors::SingleThreadedExecutor executor;
1268
- SetUpAndActivateTrajectoryController (executor, true , {});
1265
+ SetUpAndActivateTrajectoryController (executor, {});
1269
1266
subscribeToState ();
1270
1267
1271
1268
// TODO(anyone): add expectations for velocities and accelerations
@@ -1295,7 +1292,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_ignore_old_trajectory)
1295
1292
TEST_P (TrajectoryControllerTestParameterized, test_ignore_partial_old_trajectory)
1296
1293
{
1297
1294
rclcpp::executors::SingleThreadedExecutor executor;
1298
- SetUpAndActivateTrajectoryController (executor, true , {});
1295
+ SetUpAndActivateTrajectoryController (executor, {});
1299
1296
subscribeToState ();
1300
1297
1301
1298
std::vector<std::vector<double >> points_old{{{2 ., 3 ., 4 .}, {4 ., 5 ., 6 .}}};
@@ -1328,7 +1325,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_execute_partial_traj_in_futur
1328
1325
{
1329
1326
rclcpp::Parameter partial_joints_parameters (" allow_partial_joints_goal" , true );
1330
1327
rclcpp::executors::SingleThreadedExecutor executor;
1331
- SetUpAndActivateTrajectoryController (executor, true , {partial_joints_parameters});
1328
+ SetUpAndActivateTrajectoryController (executor, {partial_joints_parameters});
1332
1329
subscribeToState ();
1333
1330
1334
1331
RCLCPP_WARN (
@@ -1388,7 +1385,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_jump_when_state_tracking_erro
1388
1385
rclcpp::executors::SingleThreadedExecutor executor;
1389
1386
// default if false so it will not be actually set parameter
1390
1387
rclcpp::Parameter is_open_loop_parameters("open_loop_control", false);
1391
- SetUpAndActivateTrajectoryController(executor, true, {is_open_loop_parameters}, true);
1388
+ SetUpAndActivateTrajectoryController(executor, {is_open_loop_parameters}, true);
1392
1389
1393
1390
// goal setup
1394
1391
std::vector<double> first_goal = {3.3, 4.4, 5.5};
@@ -1489,7 +1486,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_no_jump_when_state_tracking_e
1489
1486
{
1490
1487
rclcpp::executors::SingleThreadedExecutor executor;
1491
1488
rclcpp::Parameter is_open_loop_parameters("open_loop_control", true);
1492
- SetUpAndActivateTrajectoryController(executor, true, {is_open_loop_parameters}, true);
1489
+ SetUpAndActivateTrajectoryController(executor, {is_open_loop_parameters}, true);
1493
1490
1494
1491
// goal setup
1495
1492
std::vector<double> first_goal = {3.3, 4.4, 5.5};
@@ -1587,7 +1584,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_hw_states_has_offset_first_co
1587
1584
joint_vel_[i] = std::numeric_limits<double >::quiet_NaN ();
1588
1585
joint_acc_[i] = std::numeric_limits<double >::quiet_NaN ();
1589
1586
}
1590
- SetUpAndActivateTrajectoryController (executor, true , {is_open_loop_parameters}, true );
1587
+ SetUpAndActivateTrajectoryController (executor, {is_open_loop_parameters}, true );
1591
1588
1592
1589
auto current_state_when_offset = traj_controller_->get_current_state_when_offset ();
1593
1590
@@ -1634,7 +1631,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_hw_states_has_offset_later_co
1634
1631
joint_vel_[i] = 0.25 + i;
1635
1632
joint_acc_[i] = 0.02 + i / 10.0 ;
1636
1633
}
1637
- SetUpAndActivateTrajectoryController (executor, true , {is_open_loop_parameters}, true );
1634
+ SetUpAndActivateTrajectoryController (executor, {is_open_loop_parameters}, true );
1638
1635
1639
1636
auto current_state_when_offset = traj_controller_->get_current_state_when_offset ();
1640
1637
@@ -1676,7 +1673,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_state_tolerances_fail)
1676
1673
rclcpp::Parameter (" constraints.joint3.trajectory" , state_tol)};
1677
1674
1678
1675
rclcpp::executors::MultiThreadedExecutor executor;
1679
- SetUpAndActivateTrajectoryController (executor, false , { params} , true );
1676
+ SetUpAndActivateTrajectoryController (executor, params, true );
1680
1677
1681
1678
// send msg
1682
1679
constexpr auto FIRST_POINT_TIME = std::chrono::milliseconds (100 );
@@ -1708,7 +1705,7 @@ TEST_P(TrajectoryControllerTestParameterized, test_goal_tolerances_fail)
1708
1705
rclcpp::Parameter (" constraints.goal_time" , goal_time)};
1709
1706
1710
1707
rclcpp::executors::MultiThreadedExecutor executor;
1711
- SetUpAndActivateTrajectoryController (executor, false , { params} , true );
1708
+ SetUpAndActivateTrajectoryController (executor, params, true );
1712
1709
1713
1710
// send msg
1714
1711
constexpr auto FIRST_POINT_TIME = std::chrono::milliseconds (100 );
0 commit comments