Revision history [back]

There are MUCH cleaner ways to do it, but if a hack is good enough for you for now, you should be able use the ROS command line arguments to pass in the parameter generated from backtick evaluation like so:

<node pkg="uvc_camera" name="my_camera" type="camera_node" args="_device:=/dev/video$(find uvc_camera)/serial_loc.sh"/>  Do you think you could incorporate the magic in "serial_loc.sh" into uvc_camera and post a patch that gets the camera via UID defined in a ros parameter? There are MUCH cleaner ways to do it, but if a hack is good enough for you for now, you should be able use the ROS command line arguments to pass in the parameter generated from backtick evaluation like so: <node pkg="uvc_camera" name="my_camera" type="camera_node" args="_device:=/dev/video$(find uvc_camera)/serial_loc.sh"/>


Seriously though, don't do this.

Do you think you could incorporate the magic in "serial_loc.sh" into uvc_camera and post a patch that gets the camera via UID defined in a ros parameter?

So, while all nodes can have guard attributes ("if" and "unless"), you can't execute arbitrary code inside of roslaunch xml attributes. That's why what you're trying isn't working. Also, this is a feature, not a bug. If people could execute arbitrary stuff in launchfiles, the roslaunch semantics would go out the window, light turns to dark, life to death, forever.

There are MUCH cleaner ways to do it, but if a hack is good enough for you for now, you should be able use the ROS command line arguments to pass in the parameter generated from backtick evaluation like so:

<node pkg="uvc_camera" name="my_camera" type="camera_node" args="_device:=/dev/video$(find uvc_camera)/serial_loc.sh"/>  Seriously though, don't do this. Do you think you could incorporate the magic in "serial_loc.sh" into uvc_camera and post a patch that gets the camera via UID defined in a ros parameter? So, while all nodes can have guard attributes ("if" and "unless"), you can't execute arbitrary code inside of roslaunch xml attributes. That's why what you're trying isn't working. Also, this is a feature, not a bug. If people could execute arbitrary stuff in launchfiles, the roslaunch semantics would go out the window, window then light turns to dark, life to death, forever. There are MUCH cleaner ways to do it, but if a hack is good enough for you for now, you should be able use the ROS command line arguments to pass in the parameter generated from backtick evaluation like so: <node pkg="uvc_camera" name="my_camera" type="camera_node" args="_device:=/dev/video$(find uvc_camera)/serial_loc.sh"/>


Seriously though, don't do this.

Do you think you could incorporate the magic in "serial_loc.sh" into uvc_camera and post a patch that gets the camera via UID defined in a ros parameter?

So, while all nodes can have guard attributes ("if" and "unless"), you can't execute arbitrary code inside of roslaunch xml attributes. That's why what you're trying isn't working. Also, this is a feature, not a bug. If people could execute arbitrary stuff in launchfiles, the roslaunch semantics would go out the window then window. Then light turns to dark, life to death, forever.

There are MUCH cleaner ways to do it, but if a hack is good enough for you for now, you should be able use the ROS command line arguments to pass in the parameter generated from backtick evaluation like so:

<node pkg="uvc_camera" name="my_camera" type="camera_node" args="_device:=/dev/video$(find uvc_camera)/serial_loc.sh"/>  Seriously though, don't do this. Do you think you could incorporate the magic in "serial_loc.sh" into uvc_camera and post a patch that gets the camera via UID defined in a ros parameter? So, while all nodes can have guard attributes ("if" and "unless"), you can't execute arbitrary code inside of roslaunch xml attributes. That's why what you're trying isn't working. Also, this is a feature, not a bug. If people could execute arbitrary stuff in launchfiles, the roslaunch semantics would go out the window. Then light turns to dark, life to death, forever. There are MUCH cleaner ways to do it, but if a hack is good enough for you for now, you should be able use the ROS command line arguments to pass in the parameter generated from backtick evaluation like so: <node pkg="uvc_camera" name="my_camera" type="camera_node" args="_device:=/dev/video$(find uvc_camera)/serial_loc.sh"/>


Seriously though, don't do this.

Do you think you could incorporate the magic in "serial_loc.sh" into uvc_camera and post a patch that gets the camera via UID defined in a ros parameter?

Or I guess you could do this:

<param name="device" command="$(find uvc_camera)/serial_loc.sh"/>  And make "serial_loc.sh" output the full device path. So, while all nodes can have guard attributes ("if" and "unless"), you can't execute arbitrary code inside of roslaunch xml attributes. That's why what you're trying isn't working. Also, this is a feature, not a bug. If people could execute arbitrary stuff in launchfiles, the roslaunch semantics would go out the window. Then light turns to dark, life to death, forever. There are MUCH cleaner ways to do it, but if a hack is good enough for you for now, you should be able use the ROS command line arguments to pass in the parameter generated from backtick evaluation like so: <node pkg="uvc_camera" name="my_camera" type="camera_node" args="_device:=/dev/video$(find uvc_camera)/serial_loc.sh"/>


Seriously though, don't do this.deleted terrible idea that should never influence anyone

Do you think you could incorporate the magic in "serial_loc.sh" into uvc_camera and post a patch that gets the camera via UID defined in a ros parameter?

Or I guess you You could do this:

<param name="device" command="\$(find uvc_camera)/serial_loc.sh"/>


And make "serial_loc.sh" output the full device path.