Closed rohanpsingh closed 3 years ago
Hi @rohanpsingh
Can mc-rtc be used to simulate a robot in Choreonoid "step-by-step"? What I want is the ability to be able to access the simulation state, apply control signals, (and also possibly change robot model parameters), and then increment the simulation by one timestep. And then do this in a loop. I'm not sure if this supported by Choreonoid itself or not.
This is possible on mc_rtc side. In fact this is implemented in the V-REP/CoppeliaSim interface and in the ROS ticker. I'm not sure this can be implemented in Choreonoid with the current integration between mc_rtc and Choreonoid (i.e. using the OpenRTM plugin in Choreonoid). If the OpenRTM plugin can take over the simulation stepping then it would be a good start.
If it can't be done with Choreonoid, I would like to create a "new mc_rtc interface" for the Mujoco physics engine. I guess the information I need to accomplish this should be gettable here, but until this page is available, could you please give me some pointers on where I could begin? And, do you think how easy/difficult would this task be?
Yeah. Unfortunately I didn't have the time (yet) to write the documentation of this. A good starting point is the ticker in the mc_rtc-magnum project. You would just need to change what happens here before/after controller.run()
here, i.e. read sensor data from Mujoco before running, and update the command after if controller.run()
is successful. If you need help feel free to ping me.
This is useful information, thanks a lot! I am a complete beginner in mc_rtc so it might take a while for me to get this done, but I will let you know here if I face issues.
Hi @gergondet I have been trying to implement the interface with mujoco but am confused by a few things:
[warning] [KinematicInertial] Real anchor frame jumped from [ 0.240349 -0.00597792 -0.0275735] to [ 0.162639 0.124982 -0.0821415] (error norm 0.000 > threshold 0.020)
[warning] [KinematicInertial] Skipping velocity update (anchor frame jumped)
Perhaps you cannot explain the random motions of the robot in mujoco, but still could tell if these warnings are caused due to the same reason.
If you need help feel free to ping me.
I could really benefit from your help here, so please let me know if there is a better way to communicate with you :)
With a lot of help of from Pierre @gergondet, I could implement the required interface with mujoco here: https://github.com/rohanpsingh/mc_mujoco So, I will close this issue!
Hi @gergondet
There are two parts to this issue:
Can mc-rtc be used to simulate a robot in Choreonoid "step-by-step"? What I want is the ability to be able to access the simulation state, apply control signals, (and also possibly change robot model parameters), and then increment the simulation by one timestep. And then do this in a loop. I'm not sure if this supported by Choreonoid itself or not.
If it can't be done with Choreonoid, I would like to create a "new mc_rtc interface" for the Mujoco physics engine. I guess the information I need to accomplish this should be gettable here, but until this page is available, could you please give me some pointers on where I could begin? And, do you think how easy/difficult would this task be?