Quantcast

First initial joint value doubles when setting <initial> tag

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

First initial joint value doubles when setting <initial> tag

Lucy
Hi!
I built my own very simple 2 DOF robot to start learning openrave, and everything seems to work fine but one thing: when I use the tag <initial> to set the joints in a different initial position than 0, the first joint will always appear to be double of the value I set (when I run robot.GetDOFValues(). I don't find the mistake, and I get the same problem in another robot I built myself. However, when setting initial joint values to the example robot "tridof.robot", it works fine.
My xml files look quite similar to the tridof.robot.xml file.
I send here my .xml code to see if you can find where is the problem and help me solving it.
Thanks in advance!!


<Robot name="Robot2DOF">
    <RotationAxis>0 0 1 90</RotationAxis>
    <KinBody>
        <Mass type="mimicgeom"><density>100000</density></Mass>
        <Body name="Base" type="static">
            <Translation>0.0 0.0 0.0</Translation>
            <Geom type="box">
                <Translation>0 0 0</Translation>
                <Extents>0.1 0.1 0.1</Extents>
                <ambientColor>1. 0. 0.</ambientColor>
                <diffuseColor>1. 0. 0.</diffuseColor>
            </Geom>
        </Body>
        <Body name="Arm1" type="dynamic">
                    <offsetfrom>Base</offsetfrom>
                    <Translation>0.0 0.0 0.1</Translation>
                    <Geom type="box">
                        <Translation>0.0 0.0 0.2</Translation>
                        <Extents>0.01 0.01 0.2</Extents>
                        <ambientColor>0 1 0</ambientColor>
                        <diffuseColor>0 1 0</diffuseColor>
                   </Geom>
            </Body>
                <Joint circular="true" name="Joint1" type="hinge">
                    <Body>Base</Body>
                   <Body>Arm1</Body>
                    <offsetfrom>Arm1</offsetfrom>
            <weight>4</weight>
                    <axis>1 0 0</axis>
                    <maxvel>3.42</maxvel>
                    <resolution>1</resolution>
            <limitsdeg>-90 90</limitsdeg>
            <initial>-0.785</initial>
            </Joint>
               <Body name="Arm2" type="dynamic">
                    <offsetfrom>Arm1</offsetfrom>
                   <Translation>0 0 0.4</Translation>
                    <Geom type="box">
                        <Translation>0 0 0.2</Translation>
                        <Extents>0.01 0.01 0.2</Extents>
                        <ambientColor>0 0 1</ambientColor>
                        <diffuseColor>0 0 1</diffuseColor>
                    </Geom>
               </Body>
            <Joint circular="true" name="Joint2" type="hinge">
                    <Body>Arm1</Body>
                    <Body>Arm2</Body>
                    <offsetfrom>Arm2</offsetfrom>
            <weight>3</weight>
            <limitsdeg>-180 180</limitsdeg>
                    <axis>1 0 0</axis>
                    <maxvel>5.42</maxvel>
                    <resolution>1</resolution>
            <initial>1.570796326794</initial>
               </Joint>
    </KinBody>
    <Manipulator name="arm">
           <effector>Arm2</effector>
           <base>Base</base>
           <direction>0 0 1</direction>
           <Translation>0 0 0.4</Translation>
       </Manipulator>
</Robot>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: First initial joint value doubles when setting <initial> tag

Lucy
The problem seems to be solved by setting the base type as "dynamic" instead of "static".
Any ideas about why? How could I set a static base then?
Thanks!

Loading...