Skip to content

serving Foxy + Gazebo11 to a Web Broswer  #157

Open
@mis-eu

Description

@mis-eu

Please validate if ros2-web-bridge supports deploying a ROS2 Foxy 20.04 Focal simulation via gzclient11 to a Web browser (gzweb is still ROS1)

<title>Gazebo11 Web Bridge v 0.0.1</title>
<link rel="stylesheet" href="css/base.css">

<script type="text/javascript" src="http://static.robotwebtools.org/EventEmitter2/current/eventemitter2.min.js"></script>
<script type="text/javascript" src="http://static.robotwebtools.org/roslibjs/current/roslib.min.js"></script>
<!-- GAZEBO config
    [gazebo-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
    [gazebo-1] [Msg] Publicized address: 172.31.159.229
-->

<!-- ROS2-web-bridge 
    $ node bin/rosbridge.js 
    ros2-web-bridge: ROS2 node started +0ms
    ros2-web-bridge: Starting server on port 9090 +1ms
    Websocket started on ws://localhost:9090 -->

<script>
	let ros = new ROSLIB.Ros();
	let bridgeHost = window.location.hostname;
	let bridgePort = 9090;

// monitor the connection    
// listener for a connection event to the ros object. 
// two blocks following do the same for error and close events. 
    
	ros.on('connection', function() {
	console.log('bridge connected');
});
    ros.on('error', function(error) {
	console.log('Error connecting to websocket server: ', error);
});
    ros.on('close', function() {
	console.log('Connection to websocket server closed.');
});
    ros.connect('ws://' + bridgeHost + ':' + bridgePort);
   

</script>  


<iframe id="iframeGazebo" src="http://172.31.159.229:11345"></iframe>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions