alliedvision / vimbax_ros2_driver

ROS 2 driver for Vimba X
BSD 3-Clause "New" or "Revised" License
2 stars 9 forks source link

vimbax_camera_node generates unique namespace between launches #4

Open jsb19227 opened 1 month ago

jsb19227 commented 1 month ago

Whenever I run the vimbax_camera_node, the namespace generated is unique every time based on the PID of the node. This is causing issues with RVIZ configs and node subscriptions since the topic id of the raw image data is different each time. Is there currently a way to disable the PID concatenation to the namespace and give it a static namespace instead? I am assuming the issue stems from /vimbax_ros2_driver/vimbax_camera/src/vimbax_camera_node.cpp lines 1671-1680:

std::string VimbaXCameraNode::get_node_name()
{
  auto const pidString = [] {
#ifdef __unix__
      return std::to_string(getpid());
#endif
    }();

  return "vimbax_camera_" + pidString;
}
dlangenkamp-avt commented 3 weeks ago

Hi, You can use the command line parameters "--rosargs -r node:=cam -r ns:=/cam" to override the node name and namespace to cam.