ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Should $(find package) evaluate on remote machine's environment?

asked 2017-12-05 14:53:09 -0600

seanarm gravatar image

I have a master launch file that includes two other launch files, one of which is contained inside a group like this:

<group>
  <machine name="machine1" address="hostname1" user="root" env-loader=/root/rosws/devel/env.sh" />
  <include file="/path/to/my/launchfile.launch" />
</group>

Inside launchfile.launch, I have another include like this:

<include file="/path/to/another/launchfile.launch">
  <arg name="myfile" value="$(find somepackage)/filepath/file.yaml" />
</include>

When I launch this system, the $(find somepackage) seems to be evaluated on the host machine, giving the wrong path for the package on the remote machine. I feel like any node launched within the group with that machine should find packages within that machine tag's specified environment. Is there a way to do that, or am I going to have to live listing the absolute path?

edit retag flag offensive close merge delete

Comments

Have you tried putting the <machine> tag before your <group> tag?

jayess gravatar image jayess  ( 2017-12-05 15:38:51 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-01-24 19:39:47 -0600

seanarm gravatar image

From @gvdhoorn:

In addition to this:

When I launch this system, the $(find somepackage) seems to be evaluated on the host machine, 
giving the wrong path for the package on the remote machine."

roslaunch always evaluates everything on the local machine, not on the remote one.

edit flag offensive delete link more
1

answered 2017-12-06 01:22:03 -0600

mgruhler gravatar image

AFAIR, you have to add the default flag within the machine tag in the group. To quote the wiki:

`default="true|false|never" (optional)`

Sets this machine as the default to assign nodes to. The default setting only applies to nodes defined later in the same scope. NOTE: if there are no default machines, the local machine is used. You can prevent a machine from being chosen by setting default="never", in which case the machine can only be explicitly assigned.

Otherwise, you'd have to assign the machine explicitely.

edit flag offensive delete link more

Comments

1

In addition to this:

When I launch this system, the $(find somepackage) seems to be evaluated on the host machine, giving the wrong path for the package on the remote machine.

roslaunchalways evaluates everything on the local machine, not on the remote one.

gvdhoorn gravatar image gvdhoorn  ( 2017-12-06 02:13:31 -0600 )edit

Thanks, your comment is what I was looking for. Can you add it to your answer so I can mark it as correct?

seanarm gravatar image seanarm  ( 2018-01-05 10:59:44 -0600 )edit

I did not post an answer, only @mig did.

gvdhoorn gravatar image gvdhoorn  ( 2018-01-05 11:01:28 -0600 )edit

Is there any way I can include a launch file which is stored in the remote machine? Calling a launch file (from host/local) and running it on a remote node is working but frequency transmission is slow. When I run the node directly from the remote machine the transmission has a normal frequency rate - hence it is not a network problem.

sacco22 gravatar image sacco22  ( 2019-10-02 09:10:19 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-12-05 14:53:09 -0600

Seen: 266 times

Last updated: Jan 24 '18