Robotics StackExchange | Archived questions

ROS Multiple machines /Slave setup joy control,

I am trying to control my robot slave from my master machine using the joy node and ackerman_cmd.. this works fine when I run rescore solely on my slave(no multiple machines) and use the keyboard as input.

Trying to replicate this when i have the master and slave setup seems to not work. i can see the /joy and ackermanncmd topic on my slave but no control.. doing rostopic echo /ackermanncmd shows no messages.. although i can see the messages on my master.. Any ideas as to why would be appreciated. Thanks

Asked by fyi on 2019-08-11 14:48:42 UTC

Comments

Are you sure to have set ROS_MASTER_URI and ROS_IP on both machines?

Asked by krl101 on 2019-08-12 04:16:19 UTC

I believe so i can see my lidar data from my slave robot and other data on rviz on my master but i cannot send ackermann commands to the my slave

so to elaborate i can see data from the slave i.e my sensors, map, imu on my master but cannot receive ackermann commands sent from my master to the slave. my view was communication was bidirectional . i can see the topics showing on my slave but no information coming in

Asked by fyi on 2019-08-12 05:07:18 UTC

Communication is bidirectional, with source/sink aka. Publisher/Subscriber in depth. Apart from ROS_MASTER_URI (the same) and ROS_IP (respective IP/hostname) for each machine, is a node not online or has special parameters that do not apply? Can you double check rosnode list and/or rostopic list?

Asked by krl101 on 2019-08-12 05:45:24 UTC

Heres what my bash file looks like on my master and

export ROS_MASTER_URI=http://localhost:11311/ export ROS_IP=192.20.10.5 export ROS_HOSTNAME=$ROS_IP source ~/catkin_ws/devel/setup.bash source ~/catkin_ws/install_isolated/setup.bash echo "ROS_IP: "$ROS_IP echo "ROS_HOSTNAME: "$ROS_HOSTNAME echo "ROS_MASTER_URI: "$ROS_MASTER_URI

on slave

export ROS_MASTER_URI=http://192.20.10.5:11311/ export ROS_IP=192.20.10.6 export ROS_HOSTNAME=$ROS_IP source ~/catkin_ws/devel/setup.bash source ~/catkin_ws/install_isolated/setup.bash echo "ROS_IP: "$ROS_IP echo "ROS_HOSTNAME: "$ROS_HOSTNAME echo "ROS_MASTER_URI: "$ROS_MASTER_URI

i can see the rosnode list on the slave swell as the topics ackermann_cmd and joy from my master

should my Ros_master_uri be the same?

Asked by fyi on 2019-08-12 07:40:32 UTC

so i tried rosnode info and it shows

Node [/ackermann_drive_keyop_node] Publications: * /ackermann_cmd [ackermann_msgs/AckermannDriveStamped] * /rosout [rosgraph_msgs/Log]

Subscriptions: None

Services: * /ackermann_drive_keyop_node/get_loggers * /ackermann_drive_keyop_node/set_logger_level

contacting node http://parallels-vm:40139/ ... ERROR: Communication with node[http://parallels-vm:40139/] failed!

Asked by fyi on 2019-08-12 08:08:10 UTC

Answers

Figured it out. it works now. need to ensure i run my bash setup file in every terminal i open if not things don't work well with other nodes I start. i was opening a new terminal without doing that so for some reason it wasn't sending any information out to the slave..

Thanks.

Asked by fyi on 2019-08-12 10:02:08 UTC

Comments

in your ~/.bashrc you can add:

source /opt/ros/<ros-version>/setup.bash
source /<catkin_ws>/devel/setup.bash

like in: Installing and Configuring Your ROS Environment And every "new" terminal (or after sourceing) is up to date an running.

Asked by krl101 on 2019-08-13 04:18:01 UTC

Thank you added just needed to ensure i ran it in every terminal/new tab which i didnt

Asked by fyi on 2019-08-13 07:01:42 UTC