@@ -812,8 +812,9 @@ TEST_F(TestLoadController, test_spawner_parsed_controller_ros_args)
812
812
813
813
// Now test the remapping of the service name with the controller_ros_args
814
814
EXPECT_EQ (
815
- call_spawner (
816
- " ctrl_2 -c test_controller_manager --controller-ros-args '-r /ctrl_2/set_bool:=/set_bool'" ),
815
+ call_spawner (" ctrl_2 -c test_controller_manager --controller-ros-args '-r "
816
+ " /ctrl_2/set_bool:=/set_bool' --controller-ros-args '--param "
817
+ " run_cycle:=20 -p test_cycle:=-11.0'" ),
817
818
0 );
818
819
819
820
ASSERT_EQ (cm_->get_loaded_controllers ().size (), 2ul );
@@ -826,6 +827,20 @@ TEST_F(TestLoadController, test_spawner_parsed_controller_ros_args)
826
827
node->create_client <example_interfaces::srv::SetBool>(" /ctrl_2/set_bool" );
827
828
ASSERT_FALSE (ctrl_2_set_bool_service->wait_for_service (std::chrono::seconds (2 )));
828
829
ASSERT_FALSE (ctrl_2_set_bool_service->service_is_ready ());
830
+
831
+ // Check the parameter run_cycle to have the right value
832
+ ASSERT_EQ (" ctrl_2" , cm_->get_loaded_controllers ()[0 ].info .name );
833
+ auto ctrl_2 = cm_->get_loaded_controllers ()[0 ].c ->get_node ();
834
+ if (!ctrl_2->has_parameter (" run_cycle" ))
835
+ {
836
+ ctrl_2->declare_parameter (" run_cycle" , -200 );
837
+ }
838
+ ASSERT_THAT (ctrl_2->get_parameter (" run_cycle" ).as_int (), 20 );
839
+ if (!ctrl_2->has_parameter (" test_cycle" ))
840
+ {
841
+ ctrl_2->declare_parameter (" test_cycle" , 1231.0 );
842
+ }
843
+ ASSERT_THAT (ctrl_2->get_parameter (" test_cycle" ).as_double (), -11.0 );
829
844
}
830
845
831
846
class TestLoadControllerWithoutRobotDescription
0 commit comments