Thanks @Martin_Guenther, @de-vri-es and @tfoote for your comments and suggestions. I came up with a solution based on an `env`-based wrapper script that works with both `rosrun` and within `launch` files. I could not get @tfoote's suggestion of using the `<machine>` tag to work on a local machine. I second @Martin_Guenther's [point](
https://discourse.ros.org/t/is-it-a-good-practice-to-force-rpath-to-be-embedded-in-the-installed-targets/1335/6?u=mani) about this suggestion.
Here is the wrapper script I wrote:
https://github.com/AutonomyLab/bebop_autonomy/blob/adynathos-indigo-devel/bebop_driver/scripts/bebop_env_loader
It simply looks at `LD_LIBRARY_PATH` environmental variable. If it is set, it picks the first element, adds `parrot_arsdk` to the end of that element and adds the modified element to the head of `LD_LIBRARY_PATH`. Then it executes any specified binary and arguments with the `env` command using the modified `LD_LIBRARY_PATH`.
For example if `LD_LIBRARY_PATH` is set to `/opt/ros/kinetic/lib:...`, it executes the following command:
```bash
$ env LD_LIBRARY_PATH=/opt/ros/kinetic/lib/parrot_arsdk:/opt/ros/kinetic/lib:... /path/to/binary [args]
```
This way it can be used both by `rosrun` and within launch files in a quite portable way:
```bash
$ rosrun --prefix "rosrun bebop_driver bebop_env_loader" bebop_driver bebop_driver_node
```
or
```xml
<node pkg="bebop_driver" name="bebop_driver" type="bebop_driver_node" launch-prefix="$(find bebop_driver)/scripts/bebop_env_loader">
```
I did some testing and it seems to be working fine. Is this the solution you were suggesting?
---
[Visit Topic](
https://discourse.ros.org/t/is-it-a-good-practice-to-force-rpath-to-be-embedded-in-the-installed-targets/1335/8) or reply to this email to respond.
If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
ros-users@lists.ros.org
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <
http://lists.ros.org/mailman//options/ros-users>