isri-aist / BaselineWalkingController

Humanoid walking controller with various baseline methods
https://isri-aist.github.io/BaselineWalkingController
BSD 2-Clause "Simplified" License
110 stars 19 forks source link

Issue about surface contact setting during double foot support periods #16

Closed EthanZengg closed 5 months ago

EthanZengg commented 1 year ago

Hello, Dr. Gergondet (@gergondet),

I apologize for bothering you, but I am experiencing some issues with the controller on my robot. During double foot support periods, the robot loses contact with the floor, and its feet cross the ground. However, during the walking process, this problem disappears. The process unfolds as follows:

1.Initially, the robot is set at the proper height.

2.Upon clicking "Start" to enter the BWC::Main_ state, the ControlRobotModel moves down slowly due to gravity, causing its feet to cross the ground.

3.I set the walking parameters and click "walk," after which the ControlRobotModel quickly returns to its original height and walks normally.

4.Once the walking is finished, the robot's feet cross the ground again.

It seems that there is an issue with the contact setting during the double foot support periods. Could you please provide me with some advice on how to address this problem?

Thank you for your time and assistance.

Best regards, Ethan

mmurooka commented 1 year ago

Hi @EthanZengg

EthanZengg commented 1 year ago

Hi @mmurooka Thanks for the reply .

Video is as follows: (For better visibility, Rviz only displays the ControlRobotModel) https://github.com/isri-aist/BaselineWalkingController/assets/73087353/9d2131fb-c9c3-41b8-b385-f90b337e8a8e

The commands I ran are as follows:

Terminal 1 $ ./clear-omninames.sh $ choreonoid sim_mc.cnoid --start-simulation

Terminal 2 $ source ~/ros/ws_bwc/devel/setup.bash $ roslaunch baseline_walking_controller display.launch

Hope this helps

mmurooka commented 1 year ago

Thank you for sharing the video, Rviz has two robots that can be visualized, ControlRobot and RealRobot. Which one is visualized in the video?

mmurooka commented 1 year ago

Could you try increasing the following parameters by 10 times?

https://github.com/isri-aist/BaselineWalkingController/blob/52da546486e528b79475c2f7bb364fb3a65b1a9c/etc/BaselineWalkingController.in.yaml#L190

I suspect that there is a large difference in the robot's total mass between the VRML model loaded in Chorenoid and the URDF model referenced in the controller.

EthanZengg commented 1 year ago

it didn't solve the issue. Based on your description, it seems that your guess is correct. The simulation runs very slowly with the VRML. A new video is as follow, the all-black model represents the RealRobot, while the translucent model represents the ControlRobot. Please note that the observation may be slightly challenging due to the absence of mesh files.

https://github.com/isri-aist/BaselineWalkingController/assets/73087353/84140f47-1461-4491-9b73-2ed955ce6745

gergondet commented 1 year ago

Hello @EthanZengg

Are the force sensors of your robot connected to mc_openrtm?

EthanZengg commented 1 year ago

Hello Dr. Gergondet (@gergondet),

I have only attached the rfsensor and lfsensor to the robot, as it seems that the problem is not related to other sensors ( that's my guess). The attached pictures depict the robot's RTsystem configuration.

RTMsystem

item tree

This configuration appears to be the cause of the problem. Could you please provide me with some advice on how to address it?

mmurooka commented 1 year ago

Indeed, the video looks like the robot's behavior when the force sensor value is zero all the time. Could you share the mc_rtc log (*.bin file in /tmp) to confirm this?

However, I do not know why the force sensor value is zero all the time. The RTC port connections above appear to be correct. Can you confirm that the force sensor values are correct on Choreonoid according to the following document? https://choreonoid.org/en/documents/1.5/simulation/sensor-visualization.html

EthanZengg commented 1 year ago

Thank you for your notification. I discovered that the orientation of the force sensor was incorrect, and I promptly corrected it. The subsequent images depict the body state view on Choreonoid and the mc_rtc log related to the RightFootForceSensor. It seems that the data is correct now after the correction. Nevertheless, the issue persists.

屏幕截图_1 屏幕截图_3

Thank you for your patient response. Could you please provide me with a few more hints?

mmurooka commented 1 year ago

Since the same sensor values are described in the Choreonoid and the mc_rtc log, the data port of the RTC is correctly connected. Would you be able to share the mc_rtc log in some way so that we can examine it more closely?

EthanZengg commented 1 year ago

Thanks for the reply.The latest mc_rtc log (*.bin file) has been sent to your email and following file is the corresponding video after correcting the orientation of the force sensor . I hope this will be helpful

https://github.com/isri-aist/BaselineWalkingController/assets/73087353/16acc653-a353-4ba0-bb25-1963f4271256

mmurooka commented 1 year ago

Large forces are recorded in FootTask_Left_measuredWrench_fx in the log, which means that the X-axis of the foot surface is in the vertical direction. BaselineWalkingController (and many other mc_rtc contrllers) assume that the normal direction of the surface is the Z axis. It is necessary to modify the RSDF file, etc. accordingly.

EthanZengg commented 1 year ago

Dear mmurooka,

Thank you for your patient and helpful responses, which enabled me to successfully fix the bug! !

Best regards, EthanZengg

mmurooka commented 1 year ago

@EthanZengg Good! I would appreciate it if you could post a video of the robot walking.

EthanZengg commented 1 year ago

Dear mmurooka,

It's my honor. However, The robot is currently facing challenges in keeping steady while walking due to other issues (I guess), such as format conversion problem about VRML by simtrans ) , Other Sensors addition(gsensor, gyrometer, etc.), The proper configuration of mc_rtc tasks, ect. I will resolve these issues one by one diligently.

Once again, sincerely grateful for your generous sharing of numerous controllers, which greatly aided me when I first started working with biped robots.

Best regards, EthanZengg

mmurooka commented 7 months ago

Force sensor measurements do not depend on mesh coordinates or RSDF, but only on the sensor coordinates defined in the robot module class. example: https://github.com/jrl-umi3218/mc_rtc/blob/69397dc8f1494c49af9be0a2051e9dc20d74844d/src/mc_robots/jvrc1.cpp#L98

In the first case of your comment above, how about changing the orientation of the force sensor coordinates, e.g. sva::PTransformd(sva::RotX(0.5 * mc_rtc::constants::PI)) or sva::PTransformd(sva::RotY(0.5 * mc_rtc::constants::PI )) ?

gergondet commented 7 months ago

Force sensor measurements do not depend on mesh coordinates or RSDF, but only on the sensor coordinates defined in the robot module class.

That's not exactly correct. The wrench in the graph is coming from a foot task so this is obtained via robot().frame().wrench() which is different from robot().forceSensor().wrench() in two ways.

  1. robot().forceSensor().wrench() only depends on the information provided by the interface
  2. robot().frame().wrench() depends on the transformation between the frame and the sensor (which is generally defined by the transformation between the sensor and its parent body and by the transformation between the frame and its parent body
  3. Furthermore, if the sensor is calibrated there's another transformation involved (force sensor to "true" force sensor)

When we define a surface in an rsdf file, we specify a frame relative to its parent body so changing the rsdf will change the wrench you observe in the task.

Note: it is however correct that mesh coordinates have no effect at all.

In the first case of your comment above, how about changing the orientation of the force sensor coordinate

Given that it was working before, I'm guessing there was a recent change in the simulation model that was not reflected on mc_rtc side. Possibly the force sensor was rotate in the model used by Choreonoid but not by mc_rtc

mmurooka commented 7 months ago

@gergondet, thanks for the correction, that's right!