Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

Declare parameter in Gazebo plugin node

Currently, I have the following in my gazebo plugin

  mean = bounding_boxes_settings["gaussian_noise"]["mean"].as<double>();
  standard_deviation =
      bounding_boxes_settings["gaussian_noise"]["standard_deviation"].as<double>();

and it takes inputs from a YAML file, but if I want to update the parameter value, I would have to kill the node and run it again. In ROS, I can simply declare this as a parameter and access the parameter by simply using

ros2 param list

Is there any similar methods that can be done for Gazebo where I can declare this as a Node and update the values accordingly without having to kill my node?

I did this

  this->rosnode_->mean = bounding_boxes_settings["gaussian_noise"]["mean"].as<double>();
  this->rosnode_->standard_deviation =
      bounding_boxes_settings["gaussian_noise"]["standard_deviation"].as<double>();

but it did not work and I am getting this error

error: ‘using element_type = class gazebo_ros::Node’ {aka ‘class gazebo_ros::Node’} has no member named ‘mean’

Can anyone point me in the right direction as to how I could do this in gazebo?