Ask Your Question
0

Rosbridgelb: Received a message without op

asked 2017-12-22 08:08:43 -0500

AbbasSidaoui gravatar image

updated 2017-12-22 08:27:43 -0500

I'm using ROSBridgelb to publish "OccupancyGrid Message" from Unity to ROS. However I'm always getting the "Received a message without op" error. I made sure that there is no problem with all brackets, quotation marks, commas and periods. Any help?

A screenshot of the error can be found here: https://drive.google.com/open?id=1NDK...

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-12-22 09:06:47 -0500

updated 2017-12-22 09:15:57 -0500

Hi @AbbasSidaoui !

According to the ROS Bridge Protocol http://wiki.ros.org/rosbridge_suite, when sending message to ROS Bridge you have to specify the op (Operation) field.

If you look at the link above, you will see the example message:

{ "op": "subscribe",
  "topic": "/cmd_vel",
  "type": "geometry_msgs/Twist"
}

In this message, the Operation is subscribe, which means that this ROS Bridge Client is telling ROS Bridge that he wants to subscribe to the /cmd_vel topic which publish messages of type geometry_msgs/Twist.

Looking at the error message on the picture, we can see that there is a "op": "publish", so this doesn't seen to be the problem.

What I would do in this case is try to print the "keys" of the message to see if there is a key named "op" like in the example below:

message = { "op": "subscribe",
  "topic": "/cmd_vel",
  "type": "geometry_msgs/Twist"
}

Object.keys(message)
edit flag offensive delete link more

Comments

Hello Ruben, Thanks for your help! Is there any other way to check? When trying to use "Object.Keys()", this error appears: 'Object' does not contain a definition for 'keys' . https://drive.google.com/open?id=1gWb... contains a screenshot of the function generating the msg

AbbasSidaoui gravatar image AbbasSidaoui  ( 2017-12-25 06:19:44 -0500 )edit
0

answered 2019-03-07 12:18:31 -0500

Hello, @AbbasSidaoui . I think this is too late to help you, but I hope to help someone like me, who googled with the error message.

The main cause of this strange error message is there is currently no error handler for partial/multiple/broken json data. This is mentioned in source code as a comment.

https://github.com/RobotWebTools/rosb...

So, any partial/multiple/broken json data' error is catched by this part and this causes the error message:"Received a message without op."

https://github.com/RobotWebTools/rosb...

In your case, I can see your typo in your screenshot, "frame_id" = "map". I think this was the cause.

To determine where is the typo, I recommend to put your message into json.loads() in json library of python since it is used by rosbridge_library to parse JSON.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-12-22 08:08:43 -0500

Seen: 543 times

Last updated: Dec 22 '17