Quantcast

OpenRAVEpy: Changing Robot Color / Transparency

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

OpenRAVEpy: Changing Robot Color / Transparency

MattTaylor
This post was updated on .
Hi Guys,

Not posted for a while, got all my motion planning implemented and running on our ROV, which was great.

I'm currently prototyping a new function in python, and have the situation where I want to change the defuse color of an entire robot.

I looked through the examples, and found the following in openravepy.examples.inversekinematicspick


 for igeom,geom in enumerate(picker.GetLinks()[0].GetGeometries()):
                color = zeros(3)
                color[igeom] = 1
                geom.SetDiffuseColor(color)

 
That looks like it sets each individual robot part as a primary color.

From this I have the following function;


def SetRobotDefuseColor(robot, color = np.zeros(3)):
	for link in robot.GetLinks():
		raveLogInfo("Got link: ")

		for geom in link.GetGeometries():
			raveLogInfo("   - Got geometry: ")
			geom.SetDiffuseColor(color)
		

Which should take a KinBody robot and go through all of it's geometry and set the color to a new value.

This is not happening, and in the viewer the robot remains normal 50% gray.

EDIT: (Forgot to put this in the original post, sorry!)
I added in the raveLogInfo's to make sure that the function as actual finding geometry. The output is;
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Got link: 
   - Got geometry: 
Which is what I am expecting. So it's finding the geometry, but the SetDefuseColor does not do anything.

Am I mistaken in my approach here?

- Matt
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: OpenRAVEpy: Changing Robot Color / Transparency

Rosen Diankov
Administrator
glad to hear things are working! any videos by chance? ;0)

it depends how your robot's geometry is defined in the robot XML. is it referencing VRML or IV files? if so, are you using the <render> tag? If yes, then the <render> file will always overwrite any settings.

try your function on another robot like robots/mitsubishi-pa10.dae

rosen,



2013/8/14 MattTaylor <[hidden email]>
Hi Guys,

Not posted for a while, got all my motion planning implemented and running
on our ROV, which was great.

I'm currently prototyping a new function in python, and have the situation
where I want to change the defuse color of an entire robot.

I looked through the examples, and found the following in
openravepy.examples.inversekinematicspick



That looks like it sets each individual robot part as a primary color.

>From this I have the following function;



Which should take a KinBody robot and go through all of it's geometry and
set the color to a new value.

This is not happening, and in the viewer the robot remains normal 50% gray.

Am I mistaken in my approach here?

- Matt



--
View this message in context: http://openrave-users-list.185357.n3.nabble.com/OpenRAVEpy-Changing-Robot-Color-Transparency-tp4026683.html
Sent from the OpenRAVE Users List mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: OpenRAVEpy: Changing Robot Color / Transparency

MattTaylor
Thanks Rosen,

Yes, I am using the <render> tags in the XML and loading in IV files;

<KinBody name="3DOFRobotKinbody">
    <Body name="Base" type="dynamic">
      <Geom type="trimesh">
        <Render>body_issue_1.iv 0.32</Render>
        <!-- use the cup triangles for collision detection.-->
        <!-- The last number is the scale, in case the iv files are scaled improperly.-->
        <collision>body_issue_1.iv 0.32</collision>
      </Geom>
    </Body>

    .........

</KinBody>



When changing my environment file to load in the mitsubishi-pa10.zae files the function works as expected.

So how should I go about doing this with my robot.xml files?

- Matt
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: OpenRAVEpy: Changing Robot Color / Transparency

Rosen Diankov
Administrator
hi matt,

try enclosing them in <collision> tags instead of <render> tags.

and you can always convert your robot to collada by:

openrave -save myrobot.dae myrobot.xml

best,
rosen,


2013/8/14 MattTaylor <[hidden email]>
Thanks Rosen,

Yes, I am using the <render> tags in the XML and loading in IV files;




When changing my environment file to load in the mitsubishi-pa10.zae files
the function works as expected.

So how should I go about doing this with my robot.xml files?

- Matt



--
View this message in context: http://openrave-users-list.185357.n3.nabble.com/OpenRAVEpy-Changing-Robot-Color-Transparency-tp4026683p4026685.html
Sent from the OpenRAVE Users List mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: OpenRAVEpy: Changing Robot Color / Transparency

MattTaylor
Hi Rosen,

I think converting to a dae sounds the best option.

Brilliant, that works fine now (for color changing).

Thanks,

- Matt
Loading...