Implement a new Robot Model to rosjs_resources

22 views
Skip to first unread message

clantos

unread,
Sep 27, 2012, 11:23:51 AM9/27/12
to bosch_web_visu...@googlegroups.com
Hello,

First of all I would like to congratulate you on this web visualization project !!!
Next I would like to ask you how I can implement my urdf Robot Model into the rosjs_resources package in order to visualize it with wviz.
My model uses STL and Collada meshes.
I will appreciate any guidelines or documentation on how I can include it into the rosjs_resources package.
Thank you in advance

Kind Regards,
Constantinos Lantos

Bener Suay

unread,
Sep 27, 2012, 5:19:21 PM9/27/12
to bosch_web_visu...@googlegroups.com
Hi Constantinos,

thanks for using the stack. The question you asked is a really tricky one. I will try to help you with the process but I'll need you to be patient and bare with me.

First, if you look into

rosjs_resources/resources/pr2_description

you will see how PR2 is modeled.

1. Create a directory "my_robot_description" under rosjs_resources/resources
2. rosmake wviz (this will create a copy of your resources at a location where wviz can find them)
3. To test things out, create a copy of index.html in wviz/www with the name wviz_my_robot.html
4. In wviz_my_robot.html find the following part (lines 99-101)

// 6. Set the control panel's visualization manager
visualization_control_widget.setVM(vm);
}


Make that piece of code look like the following

// 6. Set the control panel's visualization manager
visualization_control_widget.setVM(vm);
var myRobot = vm.addRobotModel("resources/my_robot_description/my_urdf.xml");
}

5. Up to this point you have a robot model installed and you edited the wviz main page so that it loads your robot model when it comes up.
6. Now cross your fingers (and that is really important) and in your web browser load

localhost:8000/wviz/wviz_my_robot.html

If you see anything being loaded, fantastic. If nothing appears, then there might be a couple of problems:

- Check if the resources folder you created are copied into wviz/www/resources/my_robot_description
- Try to open the Console of your browser (you can use Firebug for Firefox or Ctrl+Shift+J for Chrome) and send us the dump of the messages you're getting

Let us/me know, and good luck :)
Ben

27 Eylül 2012 Perşembe 11:23:51 UTC-4 tarihinde clantos yazdı:

Constantinos Lantos

unread,
Sep 29, 2012, 12:38:02 PM9/29/12
to bosch_web_visu...@googlegroups.com
Hello Ben,

Thank you for the quick answer! 

I followed your instructions but I could not get it to work :(

First of all I would like to ask about the PR2 model.

The folder name must match the package where the robot is actually defined in ROS and also the folder tree and mesh names?
For example in rosjs_resources/resources/pr2_description/pr2_urdf.xml a mesh is defined as: <mesh filename="package://pr2_description/meshes/base_v0/base.dae"/> which match exactly the folder name and mesh file under rosjs_resources/resources/

This is not the same in my case:
While the folder under resources is called lwa_description the mesh in the xml is defined as:
<mesh filename="package://schunk_description/meshes/lwa/lwa1.stl"/>

Does this make a difference?

Sorry I am not in the office right now to send you the source code of the localhost:8000/wviz/wviz_my_robot.html

Constantinos

PS I am familiar with html and javascript


--
 
 

Constantinos Lantos

unread,
Oct 1, 2012, 9:57:29 AM10/1/12
to bosch_web_visu...@googlegroups.com
Hello Ben,

I moved the whole schunk_description package into the rosjs_resources/resources folder in order for the meshes files to be in accordance to their definition in the robot's urdf file.

However this did not solve the problem. I attach the output of the wviz_my_robot.html. Please tell me if you have an idea of what might be the fault.

Thank you in advance

Costantinos
source_wviz_my_robot
Reply all
Reply to author
Forward
0 new messages