jrl-umi3218 / mc_rtc

mc_rtc is an interface for simulated and real robotic systems suitable for real-time control
BSD 2-Clause "Simplified" License
122 stars 36 forks source link

Implement in RobotModule in Python + load XML robot models #244

Open rohanpsingh opened 2 years ago

rohanpsingh commented 2 years ago

I have two questions:

gergondet commented 2 years ago

Hi Rohan,

Is it possible to implement a RobotModule in Python?

No but it isn't impossible to implement either.

Still, I would like to know how it could be done.

You need two pieces:

You would use the loader as such:

MainRobot: Python#my_module.MyRobot

Where MyRobot is a Python class that derives from mc_rbdyn.RobotModule that you instantiate in the Python RobotModule (and then extract the C++ RobotModule from the object)

do you think it is a good idea?

I would avoid using the name from_xml_file since it's a little too broad and you probably have a particular kind of XML model in mind (so e.g. from_mujoco_xml_file?)

do you have any pointers?

Not really. The only thing the function has to do is return a rbd::parsers::ParserResult and from there most of the work is done :)

gergondet commented 2 years ago

Hi @rohanpsingh

Is this still an active topic for you?

rohanpsingh commented 2 years ago

Hi @gergondet Sorry I got involved with several other stuff recently so did not have time to work on this. I started implementing your suggestions above and ultimately want to get this done, but it's currently a low priority for me.