You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gazebo VisualPlugins can be loaded in both gzserver's camera sensor rendering thread and gzclient's user camera rendering thread. Some of the VisualPlugins in irg_gazebo_plugins on the ros2 branch use gazebo_ros::Node::Get(_sdf) to initialize a ROS 2 node for the plugin (such as LinkTracksPlugin and GlobalShaderParamPlugin). As called, this helper function sets the ROS node name from the plugins XML name attribute and will give the same name to ROS nodes associated with both gzserver and gzclient.
Currently many ROS 2 features and design assumptions depend on unique node names (ros2/design#187), so it would be beneficial to follow that pattern. There is an overload of gazebo_ros::Node::Get that accepts a std::string as a second parameter to use for the ROS node name, so it is straightforward to set this name programmatically.
Some approaches to name uniqueness include adding a random suffix (based on PID or time) to the node name or a suffix based on whether the plugin is loaded by gzserver or gzclient. One approach to determining whether a VisualPlugin is loaded by gzserver or gzclient is by checking the RMT_PORT environment variable (used for visualizing profiler data), which is set to 1500 in gzserver's server_main.cc and 1501 in gzclient's main.cc. This is not elegant, but would be straightforward to implement.
The text was updated successfully, but these errors were encountered:
Gazebo VisualPlugins can be loaded in both
gzserver
's camera sensor rendering thread andgzclient
's user camera rendering thread. Some of the VisualPlugins inirg_gazebo_plugins
on theros2
branch usegazebo_ros::Node::Get(_sdf)
to initialize a ROS 2 node for the plugin (such as LinkTracksPlugin and GlobalShaderParamPlugin). As called, this helper function sets the ROS node name from the plugins XMLname
attribute and will give the same name to ROS nodes associated with bothgzserver
andgzclient
.Currently many ROS 2 features and design assumptions depend on unique node names (ros2/design#187), so it would be beneficial to follow that pattern. There is an overload of gazebo_ros::Node::Get that accepts a
std::string
as a second parameter to use for the ROS node name, so it is straightforward to set this name programmatically.Some approaches to name uniqueness include adding a random suffix (based on PID or time) to the node name or a suffix based on whether the plugin is loaded by
gzserver
orgzclient
. One approach to determining whether a VisualPlugin is loaded bygzserver
orgzclient
is by checking theRMT_PORT
environment variable (used for visualizing profiler data), which is set to1500
ingzserver
's server_main.cc and 1501 ingzclient
's main.cc. This is not elegant, but would be straightforward to implement.The text was updated successfully, but these errors were encountered: