@@ -50,14 +50,17 @@ TEST(DynParamTestNode, testDynParamsSet)
5050 t.header .frame_id = " map" ;
5151 t.child_frame_id = " base_link" ;
5252 tf_broadcaster_->sendTransform (t);
53+ t.header .frame_id = " map" ;
54+ t.child_frame_id = " test_frame" ;
55+ tf_broadcaster_->sendTransform (t);
5356
5457 costmap->on_activate (rclcpp_lifecycle::State ());
5558
5659 auto parameter_client = std::make_shared<rclcpp::AsyncParametersClient>(
5760 node->shared_from_this (),
5861 " /test_costmap/test_costmap" ,
5962 rmw_qos_profile_parameters);
60- auto results = parameter_client->set_parameters_atomically (
63+ auto results1 = parameter_client->set_parameters_atomically (
6164 {
6265 rclcpp::Parameter (" robot_radius" , 1.234 ),
6366 rclcpp::Parameter (" footprint_padding" , 2.345 ),
@@ -71,6 +74,13 @@ TEST(DynParamTestNode, testDynParamsSet)
7174 rclcpp::Parameter (
7275 " footprint" ,
7376 " [[-0.325, -0.325], [-0.325, 0.325], [0.325, 0.325], [0.46, 0.0], [0.325, -0.325]]" ),
77+ rclcpp::Parameter (" robot_base_frame" , " test_frame" ),
78+ });
79+
80+ // Try setting robot_base_frame to an invalid frame, should be rejected
81+ auto results2 = parameter_client->set_parameters_atomically (
82+ {
83+ rclcpp::Parameter (" robot_base_frame" , " wrong_test_frame" ),
7484 });
7585
7686 rclcpp::spin_some (costmap->get_node_base_interface ());
@@ -87,6 +97,7 @@ TEST(DynParamTestNode, testDynParamsSet)
8797 EXPECT_EQ (
8898 costmap->get_parameter (" footprint" ).as_string (),
8999 " [[-0.325, -0.325], [-0.325, 0.325], [0.325, 0.325], [0.46, 0.0], [0.325, -0.325]]" );
100+ EXPECT_EQ (costmap->get_parameter (" robot_base_frame" ).as_string (), " test_frame" );
90101
91102 costmap->on_deactivate (rclcpp_lifecycle::State ());
92103 costmap->on_cleanup (rclcpp_lifecycle::State ());
0 commit comments