I have a master(Ubuntu18.04+Melodic on Jetson Nano) and slave(Ubuntu 16.04+Kinetic on PC) conected properly. I am able to run ros nodes and have full duplex without any issues when these nodes are launched via terminal.
However, I want to start these nodes on bootup on the master, which I am trying to achieve by creating service. When I run the service, the nodes launch fine and I can echo topics receive messages just fine. However, when I try to echo topics on the slave PC, I get no messages. I am still able to view the topics list and publish to these topics, but can’t receive/echo messages in any topics.
When I run
roswtf on PC, I get following errors:
ERROR: Unknown host (ubuntu) for node (/basefootprint_to_laser_broadcaster) ERROR Could not contact the following nodes: (with all the node names below it) ERROR The following nodes should be connected but aren't: (with all the node names below it) ERROR Errors connecting to the following services: (with all service names below) * service (/basefootprint_to_laser_broadcaster/set_logger_level) appears to be malfunctioning: Unable to communicate with service (/basefootprint_to_laser_broadcaster/set_logger_level), address (rosrpc://ubuntu:49211)
Posting service and related bash file:
roscore.service (this is same as used by Ubiquity robotics, except that I swapped kinetic by melodic:
(Unit) After=NetworkManager.service time-sync.target (Service) Type=forking User=ubuntu # Start roscore as a fork and then wait for the tcp port to be opened # ---------------------------------------------------------------- # Source all the environment variables, start roscore in a fork # Since the service type is forking, systemd doesn't mark it as # 'started' until the original process exits, so we have the # non-forked shell wait until it can connect to the tcp opened by # roscore, and then exit, preventing conflicts with dependant services ExecStart=/bin/sh -c ". /opt/ros/melodic/setup.sh; . ~/catkin_ws/devel/setup.sh; roscore & while ! echo exit | nc localhost 11311 > /dev/null; do sleep 1; done" (Install) WantedBy=multi-user.target
(Unit) Description=Mybot Minimal After=roscore.service (Service) Type=simple User=ubuntu WorkingDirectory=/home/ubuntu ExecStart=/home/ubuntu/mini.sh Restart=on-failure (Install) WantedBy=multi-user.target
#!/bin/bash # trial upstart script sleep 1 source /opt/ros/melodic/setup.bash source ~/catkin_ws/devel/setup.bash roslaunch my_pkg minimal.launch
As per comment of a user on answers.ros.org, it doesn’t work even when both devices are Melodic, so I don’t think the difference ROS versions are causing the issue.
I tried asking it on answers.ros.org but nothing helped(link to that question).
I was told on stackoverflow to ask here. Hope this is not offtopic here.
Any help would be much appreciated, thanks!