If your second Raspberry Pi is connected to the first one via some network interface (you can, for example, ping to it) and the rosbridge_server is running on the first Raspberry (which should if LeoUI is working), you can use roslibjs to send cmd_vel
messages to the Rover the same way it is done in leo_ui.
var ros = new ROSLIB.Ros({
url: "ws://" + robot_hostname + ":9090"
});
// Init message with zero values.
var twist = new ROSLIB.Message({
linear: {
x: 0,
y: 0,
z: 0
},
angular: {
x: 0,
y: 0,
z: 0
}
});
var cmdVelPub = new ROSLIB.Topic({
ros: ros,
name: '/cmd_vel',
messageType: 'geometry_msgs/Twist',
queue_size: 10
});
cmdVelPub.advertise();
Change robot_hostname
to the resolvable IP of the first RaspberryPi
Then, you can send command like this:
twist.linear.x = 0.2
cmdVelPub.publish(twist);