0

Rosanswers logo

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?


Originally posted by seanarm on ROS Answers with karma: 753 on 2017-12-05

Post score: 1


Original comments

Comment by jayess on 2017-12-05:
Have you tried putting the <machine> tag before your <group> tag?

2 Answers2

0

Rosanswers logo

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.


Originally posted by mgruhler with karma: 12390 on 2017-12-06

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by gvdhoorn on 2017-12-06:
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.

Comment by seanarm on 2018-01-05:
Thanks, your comment is what I was looking for. Can you add it to your answer so I can mark it as correct?

Comment by gvdhoorn on 2018-01-05:
I did not post an answer, only @mig did.

Comment by sacco22 on 2019-10-02:
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.

Matthias
  • 5,805
  • 1
  • 1
  • 1
0

Rosanswers logo

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.


Originally posted by seanarm with karma: 753 on 2018-01-24

This answer was ACCEPTED on the original site

Post score: 1