0
$\begingroup$

Rosanswers logo

There is a good tutorial for rosbridge v1 quick start, at https://code.google.com/p/brown-ros-pkg/wiki/Quick_start_rosbridge_and_ROS, but I can't find a similar tutorial for rosbridge v2, so I tried to mimic turtlesim with rosbridge 2, based on the example file under rosjs, and here is the link of my html file link text

During testing, I run the following commands in terminal,

roscore
rosrun turtlesim turtlesim_node
rosrun rosbridge_server rosbridge.py

and then load the html file in Firefox.

Basically there are two issues observed,

1 when the 4 buttons are pressed, the turtle never move and rostopic echo /turtle1/command_velocity always give me


linear: 0.0 angular: 0.0


2 the subscription to topic "/turtle/pose" returns undefined and only returns once,

Received message on /turtle1/pose: undefined

Obviously I missed something in the above html file, so appreciate if anyone can give me some clue.

thanks clark


Originally posted by clark on ROS Answers with karma: 393 on 2012-10-26

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I am not yet familiar with "ros_bundle.min.js". However, I can answer this issue using "ros.js", found under "rosbridge_clients" in the release version of rosbridge_suite. Using this ros.js, I used the following example page to control both turtlebots and AR.Drones:

https://dl.dropbox.com/u/14391589/tutorial/rosbridge_ardrone/drone_browser_teleop.html

In this case, the connection is created as follows:

var con = new Bridge("ws://localhost:9090");

Addressing point 1, publishing command velocity for moving forward is done as follows:

con.publish('/cmd_vel', {"linear":{"x":1.0,"y":0,"z":0},"angular":{"x":0,"y":0,"z":0}});

In Chrome, you should be able to inspect the actual websocket frame that is sent using the development tools (regardless of which ros.js you are using). I found this description of inspecting websocket traffic useful:

http://blog.kaazing.com/2012/05/09/inspecting-websocket-traffic-with-chrome-developer-tools/

I haven't tried subscribing to pose yet, so I will pass on speculating about the second issue.


Originally posted by odestcj with karma: 123 on 2012-11-04

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.