Control driving movements from another website

I need some help with a little problem. Since my LeO has 2 Raspberrys and my own web server (second Raspberry) I am looking for a possibility of the web server to control the rover. It’s a bit stupid about IFRAME, there has to be another solution

Many thanks for your help

@Piotr or @Blazej_Sowa - can you help here?

That would be the blast. This is one of the few problems that are still there. :-).

I just have a lot of time to code something. In any case, still 5 weeks due to an accident.

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);
1 Like

Works , thank you very much.