ADVRHumanoids / centauro-simulator

CENTAURO model for simulation
10 stars 3 forks source link

Save URDF on disk ? #9

Open XinyuanZhao opened 5 years ago

XinyuanZhao commented 5 years ago

Could you please make the URDF file generated and saved on disk every time we launch the simulation? I suppose it is helpful to have the latest URDF at hand. Another related issue is https://github.com/ADVRHumanoids/CentauroConfig/issues/3. @liesrock

liesrock commented 5 years ago

Hi @XinyuanZhao thanks for the question and the suggestion: what I thnik we need is a tool to automaticcaly update the config files (e.g. URDF) in the ROBOTConfig folder once a commit is pushed on the simulator repo: how can we do this?

ideas are welcome! @ntsagarakis @EnricoMingo @alaurenzi @nkashiri

mkamedula commented 5 years ago

From the simulation side, when a simulation runs a urdf is generated and send to the ROS parameter server. I could add a short rosnode that would save it to the urdf file on a disk. However, there are a few issues to run xbotcore with it. First, if nothing have changed, we do not have 100% compatibility between URDF used by gazebo and xbotcore. Second, roslaunch do not guarantee an order in which nodes run, so gazebo and thus RT plugins may initialize before new urdf is saved. Finally, a model run for simulation and model used for control may differ (ex. control only a lower-body or upper-body, ignore end-effectors or use more restrictive joint space limits for control).

When using ros an obvious solution is to retrieve urdf directly from a parameter server when constructing a model. This way, it is easy to separate a simulation and control models if necessary. Furthermore, if no simulation runs a urdf can still be generated with a very simple roslaunch file; although the simulator has to be found in the catkin workspace. From my experience, since my model interface works this way, it is a very comfortable solution. However, I am not sure how it would extend to hardware.