rohanpsingh / mc_mujoco

MuJoCo interface for mc-rtc
https://arxiv.org/abs/2209.00274
BSD 2-Clause "Simplified" License
77 stars 18 forks source link

error ground default sensor and zero delay observer #24

Closed N1ckfm closed 2 years ago

N1ckfm commented 2 years ago

Hi, I get this error when I run mc_mujoco:

[info] [mc_mujoco] Initialized successful.
[error] [mc_mujoco] No MuJoCo gyro sensor for Default body sensor in ground, expected to find a gyro sensor named ground_Default_gyro
[error] [mc_mujoco] No MuJoCo accelerometer sensor for Default body sensor in ground, expected to find a accelerometer sensor named ground_Default_accelerometer
[info] [mc_mujoco] MC-RTC timestep: 0.005. MJ timestep: 0.005
[info] [mc_mujoco] Hence, Frameskip: 1
[info] Initializing attitude from robot module: q=[1.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.747]
[info] Will log controller outputs to /tmp/mc-control-ismpc_walking-2022-06-20-22-49-52.bin
[info] Updated latest log symlink: /tmp/mc-control-ismpc_walking-latest.bin
[info] waiting for first computation after reset
mc_mujoco: /home/nk/state-observation/src/zero-delay-observer.cpp:173: virtual stateObservation::TimeIndex stateObservation::ZeroDelayObserver::getCurrentTime() const: Assertion `stateIsSet() && "The state vector has not been set"' failed.
Aborted (`core' generated)

I installed the last state-observation and I reinstalled the mc_rtc and mc_mujoco. I will appreciate your suggestion.

Nick

rohanpsingh commented 2 years ago

Hi,

N1ckfm commented 2 years ago

I tried with different robots and controllers, when I try:

rosrun mc_rtc_ticker mc_rtc_ticker
roslaunch mc_rtc_ticker display.launch

I get the same error:

[info] waiting for first computation after reset
mc_rtc_ticker: /home/nk/state-observation/src/zero-delay-observer.cpp:173: virtual stateObservation::TimeIndex stateObservation::ZeroDelayObserver::getCurrentTime() const: Assertion `stateIsSet() && "The state vector has not been set"' failed.
Aborted (`core' generated)

I am using state_observation manually build from the source

rohanpsingh commented 2 years ago

I get the same error:

That means it is not related to mc_mujoco and something else is off in your environment. Maybe you can get more help in https://github.com/jrl-umi3218/mc_rtc/issues. Did you try reinstalling mc-rtc?

N1ckfm commented 2 years ago

yes, I reinstalled all mc_rtc or maybe I need a previous version?

rohanpsingh commented 2 years ago

I don't think you need a previous version because the latest commit is supposed to work. Did you run the "build_and_install.sh" script again? That should bring all dependecies to the latest commit.

N1ckfm commented 2 years ago

I did I had an error and I did ninja -j1, but now I get this error when I tried to reinstall mc_rtc:

[ 81%] Built target other-tests
In file included from /home/nk/state-observation/include/state-observation/tools/rigid-body-kinematics.hpp:551,
                 from /home/nk/state-observation/include/state-observation/dynamical-system/imu-dynamical-system.hpp:20,
                 from /home/nk/state-observation/misc-tools/real-offline-flexibility-estimator.cpp:5:
/home/nk/state-observation/include/state-observation/tools/rigid-body-kinematics.hxx:676:1: internal compiler error: Violación de segmento
  676 | }
      | ^
0x7f82b49c508f ???
    /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f82b49a6082 __libc_start_main
    ../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

[ 88%] Linking CXX executable test-kinematics
cd /home/nk/state-observation/build/unit-testings && /usr/bin/cmake -E cmake_link_script CMakeFiles/test-kinematics.dir/link.txt --verbose=1
/usr/bin/c++   -pedantic -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion  -O2 -g -DNDEBUG  -rdynamic CMakeFiles/test-kinematics.dir/test-kinematics.cpp.o  -o test-kinematics  -Wl,-rpath,/home/nk/state-observation/build/src ../src/libstate-observation.so.1.4.1 /usr/lib/x86_64-linux-gnu/libboost_timer.so.1.71.0 /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0 
make[2]: exit directory '/home/nk/state-observation/build'
[ 88%] Built target test-kinematics
make[1]: exit directory '/home/nk/state-observation/build'
make: *** [Makefile:144: all] Error 2
[ERROR] Build failed for state-observation
Installation failed.
Installation log has been written to /tmp/build_and_install_warnings-2022-06-22-14-23-28.log
Please fix the issues and re-run the script.

I tried to install the last version of state-observation and then the ./build_and_install.sh in mc_rtc/utils

N1ckfm commented 2 years ago

I deleted all the folders and I reinstalled all, now I can run mc_mujoco and see the robot walking one step and then it fall. The error is similar to my first post.

[error] [mc_mujoco] No MuJoCo gyro sensor for Default body sensor in ground, expected to find a gyro sensor named ground_Default_gyro
[error] [mc_mujoco] No MuJoCo accelerometer sensor for Default body sensor in ground, expected to find a accelerometer sensor named ground_Default_accelerometer

I am using mujoco 2.10. isn't there an update that requires the use of a sensor on the ground?

rohanpsingh commented 2 years ago

This error is not really an error (see: https://github.com/rohanpsingh/mc_mujoco/issues/23) The robot is falling due to some other reason. Perhaps you're not using the correct branch of lipm-walking? If everything works fine with other controllers (Posture, CoM, ...), and robot only falls while exectuting lipm-walking, the problem lies there.

N1ckfm commented 2 years ago

yes, it works fine with CoM and Posture but the message keeps appearing when I run mc_mujoco for any controller.

[error] [mc_mujoco] No MuJoCo gyro sensor for Default body sensor in ground, expected to find a gyro sensor named ground_Default_gyro
[error] [mc_mujoco] No MuJoCo accelerometer sensor for Default body sensor in ground, expected to find a accelerometer sensor named ground_Default_accelerometer

If I use roslaunch mc_rtc_ticker display.launch and rosrun mc_rtc_ticker mc_rtc_ticker not appear the message and the robot not fall. So I guess is about mc_mujoco.

rohanpsingh commented 2 years ago

If I use roslaunch mc_rtc_ticker display.launch and rosrun mc_rtc_ticker mc_rtc_ticker not appear the message and the robot not fall.

This is not dynamic simulation, so I'm not surprised the robot doesn't fall :)

I think it is safe to ignore the error message and investigate other reasons for the falling behavior.

N1ckfm commented 2 years ago

This error is not really an error (see: #23) The robot is falling due to some other reason. Perhaps you're not using the correct branch of lipm-walking? If everything works fine with other controllers (Posture, CoM, ...), and robot only falls while exectuting lipm-walking, the problem lies there.

I tried with this branch https://github.com/arntanguy/lipm_walking_controller/tree/topic/stabilizer but I get this "critical":

[critical] [LIPMWalking] The observer pipeline can no longer be configured by "EnabledObservers", "RunObservers" and "UpdateObservers".
Multiple pipelines are now supported, allowing for estimation of multiple robots and/or multiple observations of the same robot.
For details on upgrading, please refer to:
- The observer pipelines tutorial: https://jrl-umi3218.github.io/mc_rtc/tutorials/recipes/observers.html
- The JSON Schema documentation: https://jrl-umi3218.github.io/mc_rtc/json.html#Observers/ObserverPipelines
terminate called after throwing an instance of 'std::runtime_error'
rohanpsingh commented 2 years ago

You need to remove the file at ~/.config/mc_rtc/controllers/LIPMWalking.conf this file is generated whenever you build the main branch and the way it manages obsevers is obsolete

N1ckfm commented 2 years ago

You need to remove the file at ~/.config/mc_rtc/controllers/LIPMWalking.conf this file is generated whenever you build the main branch and the way it manages obsevers is obsolete

The LIPMWalking controller now is working, and about the error "body sensor in ground" Due to the mc_rtc update, the way contact is handled has changed a bit, and this must be taken into account in the controller. https://jrl-umi3218.github.io/mc_rtc/tutorials/recipes/moving-a-contact.html Thanks for your support @rohanpsingh