rosbridge suite and roslibpy ros2
I have built the rosbridge suite package from source in ros2 foxy fitzroy from here. After i run the server with command "ros2 launch rosbridge_server rosbridge_websocket_launch.xml
"
and run the client/listener python script in another local pc with code:
from __future__ import print_function
import roslibpy
client = roslibpy.Ros(host='ip_of_pi', port=9090)
client.run()
listener = roslibpy.Topic(client, '/d415/camera/depth/image_rect_raw', 'sensor_msgs/msg/Image')
listener.subscribe(lambda message: print('Heard talking: ' + message['data']))
try:
while True:
pass
except KeyboardInterrupt:
client.terminate()
I'm getting this errors in the pi terminal:
[INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2020-09-08-10-00-51-244509-ubuntu-20371
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [rosbridge_websocket-1]: process started with pid [20373]
[INFO] [rosapi_node-2]: process started with pid [20375]
[rosbridge_websocket-1] [INFO] [1599559253.325205004] [rosbridge_websocket]: Rosbridge WebSocket server started on port 9090
[rosapi_node-2] [WARN] [1599559253.539470822] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[rosbridge_websocket-1] [INFO] [1599559401.996715970] [rosbridge_websocket]: Client connected. 1 clients total.
[rosbridge_websocket-1] ERROR:tornado.application:Uncaught exception GET / (192.168.1.90)
[rosbridge_websocket-1] HTTPServerRequest(protocol='http', host='192.168.1.90:9090', method='GET', uri='/', version='HTTP/1.1', remote_ip='192.168.1.90')
[rosbridge_websocket-1] Traceback (most recent call last):
[rosbridge_websocket-1] File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/web.py", line 1703, in _execute
[rosbridge_websocket-1] result = await result
[rosbridge_websocket-1] File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/websocket.py", line 278, in get
[rosbridge_websocket-1] await self.ws_connection.accept_connection(self)
[rosbridge_websocket-1] File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/websocket.py", line 881, in
accept_connection
[rosbridge_websocket-1] await self._accept_connection(handler)
[rosbridge_websocket-1] File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/websocket.py", line 964, in _accept_connection
[rosbridge_websocket-1] await self._receive_frame_loop()
[rosbridge_websocket-1] File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/websocket.py", line 1118, in _receive_frame_loop
[rosbridge_websocket-1] await self._receive_frame()
[rosbridge_websocket-1] File "/home/ubuntu/.local/lib/python3.8/site-packages/tornado/websocket.py", line 1165, in _receive_frame
[rosbridge_websocket-1] if new_len > self.params.max_message_size:
[rosbridge_websocket-1] TypeError: '>' not supported between instances of 'int' and 'NoneType'
Here i have built the ros2 branch of the rosbridge suite in my pi 4B. Raspberry pi 4B: OS : ubuntu server 20.04 ROS version: ROS2 foxy fitzroy rosbride suite branch : ros2
I"m also trying to get the rosbridge_suite to work with ros2. Did you really run
ros2 launch rosbridge_server rosbridge_websocket_launch.xml
? I tried that but it fails because the launch has to be written in python in ros2. So I wrote my own launch script because it's not packaged with wip ros2 branch on https://github.com/RobotWebTools/rosb...Hi @fredBeauj Can you please share your ros2 launch file for ros2 rosbridge server websocket? Thanks
@SBar Here is where I used it https://gitlab.com/autowarefoundation... Ignore my previous comment about xml, that works in foxy, I had been using dashing when I posted my comment
Thanks @fredBeauj I've tried to create a launch based on what you sent:
from launch import LaunchContext from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch.actions import ExecuteProcess from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node from launch_ros.substitutions import FindPackage from pathlib import Path
import os
context = LaunchContext()
def generate_launch_description(): web_bridge = Node( package='rosbridge_server', node_name='rosbridge_server_node', node_namespace='gui', node_executable='rosbridge_websocket' )
return LaunchDescription([web_bridge])
But when I try to launch it I'm getting this error: OSError: [WinError 193] %1 is not a valid Win32 application
Any idea why? I'm on windows and I compiled the ros2 branch