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 |
Administrator
|
glad to hear things are working! any videos by chance? ;0) try your function on another robot like robots/mitsubishi-pa10.daeit 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. rosen, 2013/8/14 MattTaylor <[hidden email]> Hi Guys, ------------------------------------------------------------------------------ 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 |
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 |
Administrator
|
hi matt, try enclosing them in <collision> tags instead of <render> tags.openrave -save myrobot.dae myrobot.xml rosen, 2013/8/14 MattTaylor <[hidden email]> Thanks Rosen, ------------------------------------------------------------------------------ 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 |
Hi Rosen,
I think converting to a dae sounds the best option. Brilliant, that works fine now (for color changing). Thanks, - Matt |
Free forum by Nabble | Edit this page |