ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

salsalam's profile - activity

2021-03-04 14:43:23 -0600 received badge  Famous Question (source)
2018-02-06 23:51:08 -0600 received badge  Notable Question (source)
2017-04-16 07:53:24 -0600 received badge  Famous Question (source)
2017-03-02 01:42:57 -0600 received badge  Famous Question (source)
2016-10-31 06:16:27 -0600 received badge  Notable Question (source)
2016-10-31 06:16:27 -0600 received badge  Popular Question (source)
2016-10-26 11:58:30 -0600 received badge  Notable Question (source)
2016-10-26 11:58:30 -0600 received badge  Popular Question (source)
2016-04-27 13:21:28 -0600 received badge  Popular Question (source)
2016-04-27 11:07:37 -0600 asked a question rosbridge_server UDP advertise does go through

On my ROS node I am running the 7.14 version of rosbridge_server which has an option to launch so that it uses UDP to talk to clients. This is desirable because I'm interfacing a joystick and I want messages to drop if they don't get through initially.

Every now and then the advertise message from the client doesn't get through. Of course afterwards, all the topic messages fail because rosbridge is not a publisher of that message.

Obviously I can't use TCP to advertise and then UDP to publish joystick messages (teleop).

I can't think of a way to determine if the advertise worked.

1) Can I query rosbridge using UDP to determine what topics its a publisher of?

2) I think it will work if I create a launch file on the ROS node side that - "roslaunch rosbridge_server rosbridge_udp.launch" and then launches a C++ or python script that simply sends rosbridge a JSON message for advertise of messages I'm expecting from a remote client. I believe this will make rosbridge_server a publisher of those topics, so that if the advertise fails, it will still publish the messages correctly.

I appreciate any thoughts on this subject (I was going to say topic :-)).

2016-04-05 12:27:20 -0600 asked a question Rosbridge_server - formatting header with JSON

I have a simple python script that I can't upload because I don't have 5 points. My script "advertise" sensor_msgs/Joy and then tries to send one with a header. The same code works for the json string that defines a joy_topic message with no header. Can someone tell me if I'm forming my json string incorrectly??? Thanks for you help and time...

Script is below;

Blockquote #!/usr/bin/env python

import socket, time import pygame import rospy #from geometry_msgs.msg import Twist #from sensor_msgs.msg import Joy

topicMessage = ''' { "op": "advertise", "type": "sensor_msgs/Joy", "topic": "joy_topic" } '''

if __name__ == '__main__':

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Insert try block
# If rosbridge isn't running errno=111 connection refused
connectError=s.connect(('', 9090))


JoyMessageTryHeader = '''

{ "op": "publish", "topic": "joy_topic", "msg": { {"header": { "seq": 0, "stamp": {"secs": 123.0, "nsecs": 456.0} "frame_id": \" \"}} "axes": [], "buttons": [] }, } ''' JoyMessageTryNoHeader = ''' { "op": "publish", "topic": "joy_topic", "msg": { "axes": [], "buttons": [] } } '''

while True:

print JoyMessageTryNoHeader


    print JoyMessageTryHeader


This generates errors in rosbridge. [rosout][INFO] 2016-04-05 13:15:33,109: Rosbridge TCP server started on port 9090 [rospy.internal][INFO] 2016-04-05 13:15:33,321: topic[/rosout] adding connection to [/rosout], count 0 [rosout][INFO] 2016-04-05 13:15:44,112: [Client 0] connected. 1 client total. [rosout][ERROR] 2016-04-05 13:15:44,241: [Client 0] Received a message without an op. All messages require 'op' field with value one of: ['service_response', 'unadvertise_service', 'call_service', 'publish', 'fragment', 'subscribe', 'advertise_service', 'unsubscribe', 'unadvertise', 'advertise']. Original message was: [rospy.internal][INFO] 2016-04-05 13:15:44,276: topic[/joy_topic] adding connection to [/rostopic_15329_1459876539132], count 0 [rosout][ERROR] 2016-04-05 13:15:49,119: [Client 0] Received a message without an op. All messages require 'op' field with value one of: ['service_response', 'unadvertise_service', 'call_service', 'publish', 'fragment', 'subscribe', 'advertise_service', 'unsubscribe', 'unadvertise', 'advertise']. Original message was: { "op": "publish", "topic": "joy_topic", "msg": { {"header": { "seq": 0, "stamp": {"secs": 123.0, "nsecs": 456.0} "frame_id": " "}} "axes": [], "buttons": [] }, }

[rospy.internal][INFO] 2016-04-05 13:15:49,633: topic impl's ref count is zero, deleting topic /joy_topic... [rospy.internal][INFO] 2016-04-05 13:15:49,634: topic[/joy_topic] removing connection to /rostopic_15329_1459876539132 [rosout][WARNING] 2016-04-05 13:15:49,634: Could not process inbound connection: [/rosbridge_tcp] is not a publisher of [/joy_topic]. Topics are [['/rosout', 'rosgraph_msgs/Log']]{'message_definition': "# Reports the state of a joysticks axes and buttons.\nHeader header # timestamp in the header is the time the data is received from the joystick\nfloat32[] axes # the axes measurements from a joystick\nint32[] buttons # the buttons measurements from a joystick \n\n================================================================================\nMSG: std_msgs/Header\n# Standard metadata for higher-level stamped data types.\n# This is generally used to communicate timestamped data \n# in a particular coordinate frame.\n# \n# sequence ID: consecutively increasing ID \nuint32 seq\n#Two-integer timestamp that is expressed as:\n# * ....


2016-04-05 11:42:11 -0600 commented answer Setting header.secs and header.nsecs in JSON before publishing

Thanks for your response... Yes, I agree we should set our own timestamp, especially for time critical messages like joystick control messages that effect movement.

I tried to set the time, but rosbridge keeps saying i have sent a message with no "op". i will post a new questions with details.

2016-04-05 09:28:02 -0600 received badge  Enthusiast
2016-04-01 13:36:51 -0600 asked a question Setting header.secs and header.nsecs in JSON before publishing

I am able to send JSON to rosbridge_server (tcp) to publish custom messages to ROS and I can see the messages with rostopic echo <custom_msg>. The header information is blank except header.seq, which increments correctly.

Is there a way to have header.secs and header.nsecs reflect time rosbridge_server published???

Thanks for any help you can give me.

2016-04-01 12:05:06 -0600 commented answer Rosbridge 2.0 with raw sockets

rosbridge on the server ends up with lots of "inactive" clients as the clients die because the connect gets too flaky. I'm testing by pulling the network cable and then reconnecting if after various lengths of time.

2016-04-01 12:03:50 -0600 commented answer Rosbridge 2.0 with raw sockets

We would like to use rosbridge to remotely operate a robot over a wireless connection. Therefore UDP is desirable and I wondered if anything had ever come of this topic??? I guess I can constantly check s.send(joystickmsg) status and try to reconnect when it breaks??? rosbridge has "inactive" cli

2016-03-08 11:17:15 -0600 commented question problem with roslib

I am having the same problem.

Indigo, Ubuntu 14.04, Firefox 44.0.2 Tutorial simple.html can be found at

The Firefox webconsole reports; ReferenceError: ROSLIB is not defined (simple.html line)