Hi all,
As the title mentioned, I can not figure out the way to change the ROS_MASTER_URI for the a ros snap that I created by snapcraft.
Here are what I tried so far. My workspace has a package named main_launch
, which has a launch file usb_cam.launch
as follow:
<launch>
<arg name="video_device" default="/dev/video0" />
<machine name="quad_1"
address= "192.168.0.6"
env-loader="~/.bashrc"
user="master_computer"
password="pwd1"
default= "false" >
</machine>
<nodemachine="quad_1" name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
</node>
</launch>
and in the ~/.bashrc
file, i added the following line
export ROS_HOSTNAME=192.168.0.6
export ROS_MASTER_URI=http://192.168.0.28:11311/
source /opt/ros/lunar/setup.bash
source ~/my_Workspace/devel/setup.bash
Above, 192.168.0.28
is the ip address of Master compute, which will run roscore. 192.168.0.6
is the ip address of Remote computer, that I will run the snap package.
My snapcraft.yaml is as follows:
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
parts:
workspace:
plugin: catkin
rosdistro: lunar
catkin-packages: [main_launch, aruco_localization]
apps:
usbcam:
command: roslaunch main_launch usb_cam_launch.launch
plugs: [network, network-bind]
Then I compiled snap by snapcraft, and install the snap package on my remote computer,
On MAster Computer, I run roscore
.
On Remote, I do: my-ros-snap.usbcam
, but I still see this
auto-starting new master
process[master]: started with pid [4297]
ROS_MASTER_URI=http://localhost:11311
Verify on the master by running rostopic list
, none of the usb_cam
topics are published.
I also tried edit the snapcraft.yaml file as
apps:
usbcam:
command: export ROS_MASTER_URI=http://192.168.0.28:11311
command: roslaunch main_launch usb_cam_launch.launch
plugs: [network, network-bind]
but nothing works.
Please let me know if you need any additional info to clarify the problem. Thanks in advance.