ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rosbridge suite and roslibpy ros2

asked 2020-09-08 05:10:45 -0600

dinesh gravatar image

updated 2020-09-08 05:11:26 -0600

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

edit retag flag offensive close merge delete

Comments

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...

fredBeauj gravatar image fredBeauj  ( 2020-09-29 08:17:23 -0600 )edit

Hi @fredBeauj Can you please share your ros2 launch file for ros2 rosbridge server websocket? Thanks

Dronist gravatar image Dronist  ( 2020-10-28 03:51:19 -0600 )edit

@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

fredBeauj gravatar image fredBeauj  ( 2020-10-28 08:39:15 -0600 )edit

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

Dronist gravatar image Dronist  ( 2020-10-28 11:18:54 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-09-27 16:43:16 -0600

flo gravatar image

Hey there,

I just had a similar problem, but unrelated to your webbridge packet.

Can you please confirm that your raspi has a solid network connection? I had the problem with the "Publisher already registered" in my ubuntu 20.04 machine where my network card was suddenly not connected anymore. After setting / fixing my network, everything was back to normal.

Also this 'NoneType' Error suggests, that new_len has not a type because the request for the IP address failed, as you also have a networking issue..

Just a guess into the blue, but maybe it helps..! :)

Cheers

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-09-08 05:10:45 -0600

Seen: 2,610 times

Last updated: Sep 27 '20