0
$\begingroup$

Rosanswers logo

If I receive a parameter update and want to check if its the correct type, how could I do this?
Because if I set a param over cmd line and write 1 instead of 1.0, no exception is thrown when receiving the param with false type.

void handleChangedParameters( const rcl_interfaces::msg::ParameterEvent::SharedPtr& event )
   {
      for ( auto& changed_parameter : event->changed_parameters )
      {
         auto paramName = changed_parameter.name;
         if ( paramName == controllerFrequency )
         {
            log_info(" is integer: {}", changed_parameter.value. == XXX  ? "true" : "false" )
            updateFrequencyParam( changed_parameter.value.integer_value );
         }
      }
   } 

Originally posted by madmax on ROS Answers with karma: 496 on 2019-08-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Ok, found the answer...

rclcpp::ParameterType::PARAMETER_BOOL

Originally posted by madmax with karma: 496 on 2019-08-12

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.