Moving the Turtlebot Simulator using /cmd_vel geometry_msgs/Twist JSON messages

938 views
Skip to first unread message

alom...@gmail.com

unread,
Dec 19, 2012, 2:48:00 PM12/19/12
to rosbrid...@googlegroups.com
Hi all,

I'm trying to use Rosbridge as a JSON-based communication mechanism between my own programming language and ROS.

A first test with Turtlesim went ok, I'm now trying to move the Turtlebot Simulator using /cmd_vel geometry_msg/Twist JSON messages.
The problem is that the bot is not moving at all in the simulator, and I'm wondering what the reason could be.

So here's an overview what is happening, could anything be wrong with what I'm publishing?:
Topic: "/cmd_vel"
Message: "geometry_msgs/Twist"
JSON: "{ linear: [ 0.2, 0, 0 ], angular: [ 0, 0, 0.2 ] }"

I tried publishing in a while(true) loop after reading that the bot discards messages that are sent less frequently than 0.6Hz, but no luck either.

Do I have to run an additional node that is subscribed to these messages? Or could it be an issue with the simulator (since the (albeit simpler) turtlesim worked immediately).
Seems unlikely since this from the tutorial works:
rostopic pub -r 5 cmd_vel geometry_msgs/Twist '[0.1, 0, 0]' '[0, 0, 0.2]'


Thanks!
Andoni

Chad Jenkins

unread,
Dec 19, 2012, 3:17:07 PM12/19/12
to rosbrid...@googlegroups.com

Hi Andoni,

Are you using rosbridge v1 or v2?

I would suggest looking at Trevor Jay's tutorial for interfacing with rosbridge v1 using netcat from the command line:

  http://brown-robotics.org/wp/rosbridge-in-10-minutes/

Because you are writing your own client library for your language, this minimal usage of rosbridge should provide what you need.  As described in this tutorial, I suspect your problem could relate to the initial handshake or the padding added to each object to disambiguate raw and websocket connections.

-Chad


--
You received this message because you are subscribed to the Google Groups "Rosbridge Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rosbridge-users/-/n06ozQKA3AwJ.
To post to this group, send email to rosbrid...@googlegroups.com.
To unsubscribe from this group, send email to rosbridge-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rosbridge-users?hl=en.

alom...@gmail.com

unread,
Dec 19, 2012, 4:26:55 PM12/19/12
to rosbrid...@googlegroups.com
Thanks for the info, I'm watching the movie now.

I just installed rosbridge, so I'm assuming v2 (I have currently no access to this machine).

What I forgot to mention is that my language has a FFI (well, more language symbiosis) to Java, and I use the Java implementation of rosbridge (rosbrige.java) for pub/sub, which I'm assuming is doing the correct handshaking and padding.
In any case, it seems to work with a different simulator, so I guess this is not the problem.

Op woensdag 19 december 2012 21:17:07 UTC+1 schreef Chad Jenkins het volgende:

Chad Jenkins

unread,
Dec 19, 2012, 8:43:46 PM12/19/12
to rosbrid...@googlegroups.com

Just for clarification, that video tutorial applies to rosbridge v1, which is part of the brown-remotelab stack.  I have not used rosbridge.java.  rosbridge.java looks to be for v1 given the check in dates:

  https://code.google.com/p/brown-ros-pkg/source/browse/trunk/rosbridge_clients/Java?r=2788#Java%2Fsrc%2Fedu%2Fbrown%2Frobotics%2Frosbridge

If you installed v2, which is part of the rosbridge-suite stack, you should refer to the protocol specification available here:

  http://kforge.ros.org/rosbridge/trac/raw-attachment/wiki/WikiStart/rosbridge%20protocol%20specification.pdf

A quick way to tell if you are using v1 or v2 is to use "rosnode list".  If you see "rosbridge_server", you are using v2.  If you see "rosbridge", then v1.

-Chad

To view this discussion on the web visit https://groups.google.com/d/msg/rosbridge-users/-/bAkIkeKvEikJ.
Reply all
Reply to author
Forward
0 new messages