Programmatic Robot creation

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Programmatic Robot creation

Steve
I am having trouble programmatically creating a Robot in python.
I can build a KinBody using the method of:
http://openrave.org/docs/latest_stable/tutorials/openravepy_examples/#creating-custom-kinematics-body,
but now I need to attach a manipulator. But the AddManipulator method only works on a Robot instance, not a KinBody.
I tried creating a Robot with the Robot.Init() method, but that requires an AttachedSensorInfo list argument. While LinkInfo(), JointInfo(), and ManipulatorInfo() methods exist, there doesn't seem to be a way to create an AttachedSensorInfo() object. What am I missing?

Steve
Reply | Threaded
Open this post in threaded view
|

Re: Programmatic Robot creation

Rosen Diankov
Administrator
hi steve,

just pass an empty list to the attached sensor info stuff.

rosen,



2013/7/30 Steve <[hidden email]>
I am having trouble programmatically creating a Robot in python.
I can build a KinBody using the method of:
http://openrave.org/docs/latest_stable/tutorials/openravepy_examples/#creating-custom-kinematics-body,
but now I need to attach a manipulator. But the AddManipulator method only
works on a Robot instance, not a KinBody.
I tried creating a Robot with the Robot.Init() method, but that requires an
AttachedSensorInfo list argument. While LinkInfo(), JointInfo(), and
ManipulatorInfo() methods exist, there doesn't seem to be a way to create an
AttachedSensorInfo() object. What am I missing?

Steve



--
View this message in context: http://openrave-users-list.185357.n3.nabble.com/Programmatic-Robot-creation-tp4026636.html
Sent from the OpenRAVE Users List mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&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
|

Re: Programmatic Robot creation

Steve
In reply to this post by Steve
Hi Rosen,
Thanks for the reply.

For the AttachedSensorInfos parameter, I have tried passing in empty brackets, None, [None], and list(), but always get the error:
Boost.Python.ArgumentError: Python argument types in Robot.Init(Robot, list, list, list)
did not match C++ signature:
    Init(openravepy::PyRobotBase {lvalue}, boost::python::api::object linkinfos, boost::python::api::object jointinfos, boost::python::api::object manipinfos, boost::python::api::object attachedsensorinfos)

Steve
Reply | Threaded
Open this post in threaded view
|

Re: Programmatic Robot creation

Rosen Diankov
Administrator
can you try this to see if it succeeds:

            robot=self.LoadRobot('robots/barrettwam.robot.xml')
            robot.SetTransform(eye(4))
            Trobot = robot.GetTransform()
            linkinfos = [link.UpdateAndGetInfo() for link in robot.GetLinks()]
            jointinfos = [joint.UpdateAndGetInfo() for joint in robot.GetJoints()]
            jointinfos += [joint.UpdateAndGetInfo() for joint in robot.GetPassiveJoints()]
            manipinfos = [manip.GetInfo() for manip in robot.GetManipulators()]
            # try to re-create the robot
            env2=Environment()
            robot2=RaveCreateRobot(env2,'')
            robot2.Init(linkinfos,jointinfos,manipinfos,[])
            robot2.SetName(robot.GetName())
            env2.Add(robot2)


It basically re-creates a robot on a second environment using the Init method.

i'd need to see your full code in order to figure out the problem. also, what version of openrave are you using?


rosen,



2013/7/31 Steve <[hidden email]>
Hi Rosen,
Thanks for the reply.

For the AttachedSensorInfos parameter, I have tried passing in empty
brackets, None, [None], and list(), but always get the error:
Boost.Python.ArgumentError: Python argument types in Robot.Init(Robot, list,
list, list)
did not match C++ signature:
    Init(openravepy::PyRobotBase {lvalue}, boost::python::api::object
linkinfos, boost::python::api::object jointinfos, boost::python::api::object
manipinfos, boost::python::api::object attachedsensorinfos)

Steve



--
View this message in context: http://openrave-users-list.185357.n3.nabble.com/Programmatic-Robot-creation-tp4026636p4026638.html
Sent from the OpenRAVE Users List mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&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
|

Re: Programmatic Robot creation

Steve
Your program (testbot.py) does work, but mine does not:
tutbot.py
The error is actually different from what I originally reported:
  File "tutbot.py", line 51, in <module>
    success=robot.Init([link0,link1],[joint0],[manip0],[])
TypeError: No registered converter was able to produce a C++ rvalue of type std::string from this Python object of type NoneType

It may be unrelated, but If I create a robot like so: robot = RaveCreateRobot(env,'temp')
I get the error:
Failed to create name temp, interface robot

I am using version .90

Steve
Reply | Threaded
Open this post in threaded view
|

Re: Programmatic Robot creation

Rosen Diankov
Administrator
steve,

you forgot the manipulator name ;0)

manip0._name = 'arm'

best,
rosen,



2013/7/31 Steve <[hidden email]>
Your program ( testbot.py
<http://openrave-users-list.185357.n3.nabble.com/file/n4026640/testbot.py>
) does work, but mine does not:
tutbot.py
<http://openrave-users-list.185357.n3.nabble.com/file/n4026640/tutbot.py>
The error is actually different from what I originally reported:
  File "tutbot.py", line 51, in <module>
    success=robot.Init([link0,link1],[joint0],[manip0],[])
TypeError: No registered converter was able to produce a C++ rvalue of type
std::string from this Python object of type NoneType

It may be unrelated, but If I create a robot like so: robot =
RaveCreateRobot(env,'temp')
I get the error:
Failed to create name temp, interface robot

I am using version .90

Steve



--
View this message in context: http://openrave-users-list.185357.n3.nabble.com/Programmatic-Robot-creation-tp4026636p4026640.html
Sent from the OpenRAVE Users List mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&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
|

Re: Programmatic Robot creation

Steve
Thanks Rosen :")