Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile problems #31

Open
XX-4869 opened this issue Nov 26, 2024 · 4 comments
Open

compile problems #31

XX-4869 opened this issue Nov 26, 2024 · 4 comments

Comments

@XX-4869
Copy link

XX-4869 commented Nov 26, 2024

xx@pc:~/unitree_mujoco/simulate/build$ make -j4
[ 23%] Built target jstest
[ 46%] Building CXX object CMakeFiles/unitree_mujoco.dir/src/mujoco/simulate.cc.o
[ 46%] Built target test
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc: In function ‘void {anonymous}::MakePhysicsSection(mujoco::Simulate*, int)’:
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:748:48: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’?
748 | {mjITEM_EDITINT, "MPR Iter", 2, &(opt->mpr_iterations), "1 0 1000"},
| ^~~~~~~~~~~~~~
| ls_iterations
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:749:47: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’?
749 | {mjITEM_EDITNUM, "MPR Tol", 2, &(opt->mpr_tolerance), "1 0 1"},
| ^~~~~~~~~~~~~
| ls_tolerance
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc: In member function ‘void mujoco::Simulate::Sync()’:
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2111:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’?
2111 | X(mpr_tolerance);
| ^~~~~~~~~~~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2100:39: note: in definition of macro ‘X’
2100 | if (IsDifferent(scnstate_.model.opt.name, mjopt_prev_.name))
| ^~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2111:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’?
2111 | X(mpr_tolerance);
| ^~~~~~~~~~~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2100:57: note: in definition of macro ‘X’
2100 | if (IsDifferent(scnstate_.model.opt.name, mjopt_prev_.name))
| ^~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2111:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’?
2111 | X(mpr_tolerance);
| ^~~~~~~~~~~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2103:18: note: in definition of macro ‘X’
2103 | Copy(m_->opt.name, scnstate_.model.opt.name);
| ^~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2111:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’?
2111 | X(mpr_tolerance);
| ^~~~~~~~~~~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2103:44: note: in definition of macro ‘X’
2103 | Copy(m_->opt.name, scnstate_.model.opt.name);
| ^~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2127:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’?
2127 | X(mpr_iterations);
| ^~~~~~~~~~~~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2100:39: note: in definition of macro ‘X’
2100 | if (IsDifferent(scnstate_.model.opt.name, mjopt_prev_.name))
| ^~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2127:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’?
2127 | X(mpr_iterations);
| ^~~~~~~~~~~~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2100:57: note: in definition of macro ‘X’
2100 | if (IsDifferent(scnstate_.model.opt.name, mjopt_prev_.name))
| ^~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2127:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’?
2127 | X(mpr_iterations);
| ^~~~~~~~~~~~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2103:18: note: in definition of macro ‘X’
2103 | Copy(m_->opt.name, scnstate_.model.opt.name);
| ^~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2127:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’?
2127 | X(mpr_iterations);
| ^~~~~~~~~~~~~~
/home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2103:44: note: in definition of macro ‘X’
2103 | Copy(m_->opt.name, scnstate_.model.opt.name);
| ^~~~
make[2]: *** [CMakeFiles/unitree_mujoco.dir/build.make:115:CMakeFiles/unitree_mujoco.dir/src/mujoco/simulate.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:134:CMakeFiles/unitree_mujoco.dir/all] 错误 2
make: *** [Makefile:84:all] 错误 2

@XX-4869
Copy link
Author

XX-4869 commented Nov 27, 2024

I change mpr_iterations and mpr_tolerance to ls_iterations and ls_tolerance, and then there's no problem, there's an error when I run ./unitree_mujoco

xx@pc:~/unitree_mujoco/simulate/build$ ./unitree_mujoco
MuJoCo version 3.2.6
Mujoco data is prepared
logConfigFileName:/home/xx/unitree_mujoco/simulate/build/default_logconf.json
1732678157.480751 [1] unitree_mu: selected interface "lo" is not multicast-capable: disabling multicast
Error: Joystick open failed.
段错误 (核心已转储)

@Hotsburp
Copy link

See issue#11 here. Basically, set use_joystick as 0 in the unitree_mujoco/simulate/config.yaml instead of 1. Hope it helps.

@jinsongyu-fb
Copy link

This is because mujoco renamed some fields. The solution is to pull tag 3.2.0 from mujoco and then build from source:

git clone https://github.com/google-deepmind/mujoco.git
cd mujoco
git checkout tags/3.2.0
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/local/mujoco-3.2.0
make -j32
make install

Then in this repro, unitree_mujoco/simulate/CMakeList.txt, add list(APPEND CMAKE_PREFIX_PATH "~/local/mujoco-3.2.0") before running cmake

@wuyangning
Copy link
Collaborator

xx@pc:~/unitree_mujoco/simulate/build$ make -j4 [ 23%] Built target jstest [ 46%] Building CXX object CMakeFiles/unitree_mujoco.dir/src/mujoco/simulate.cc.o [ 46%] Built target test /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc: In function ‘void {anonymous}::MakePhysicsSection(mujoco::Simulate*, int)’: /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:748:48: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’? 748 | {mjITEM_EDITINT, "MPR Iter", 2, &(opt->mpr_iterations), "1 0 1000"}, | ^~~~~~~~~~~~~~ | ls_iterations /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:749:47: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’? 749 | {mjITEM_EDITNUM, "MPR Tol", 2, &(opt->mpr_tolerance), "1 0 1"}, | ^~~~~~~~~~~~~ | ls_tolerance /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc: In member function ‘void mujoco::Simulate::Sync()’: /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2111:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’? 2111 | X(mpr_tolerance); | ^~~~~~~~~~~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2100:39: note: in definition of macro ‘X’ 2100 | if (IsDifferent(scnstate_.model.opt.name, mjopt_prev_.name)) | ^~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2111:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’? 2111 | X(mpr_tolerance); | ^~~~~~~~~~~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2100:57: note: in definition of macro ‘X’ 2100 | if (IsDifferent(scnstate_.model.opt.name, mjopt_prev_.name)) | ^~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2111:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’? 2111 | X(mpr_tolerance); | ^~~~~~~~~~~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2103:18: note: in definition of macro ‘X’ 2103 | Copy(m_->opt.name, scnstate_.model.opt.name); | ^~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2111:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_tolerance’; did you mean ‘ls_tolerance’? 2111 | X(mpr_tolerance); | ^~~~~~~~~~~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2103:44: note: in definition of macro ‘X’ 2103 | Copy(m_->opt.name, scnstate_.model.opt.name); | ^~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2127:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’? 2127 | X(mpr_iterations); | ^~~~~~~~~~~~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2100:39: note: in definition of macro ‘X’ 2100 | if (IsDifferent(scnstate_.model.opt.name, mjopt_prev_.name)) | ^~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2127:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’? 2127 | X(mpr_iterations); | ^~~~~~~~~~~~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2100:57: note: in definition of macro ‘X’ 2100 | if (IsDifferent(scnstate_.model.opt.name, mjopt_prev_.name)) | ^~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2127:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’? 2127 | X(mpr_iterations); | ^~~~~~~~~~~~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2103:18: note: in definition of macro ‘X’ 2103 | Copy(m_->opt.name, scnstate_.model.opt.name); | ^~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2127:9: error: ‘mjOption’ {aka ‘struct mjOption_’} has no member named ‘mpr_iterations’; did you mean ‘ls_iterations’? 2127 | X(mpr_iterations); | ^~~~~~~~~~~~~~ /home/xx/unitree_mujoco/simulate/src/mujoco/simulate.cc:2103:44: note: in definition of macro ‘X’ 2103 | Copy(m_->opt.name, scnstate_.model.opt.name); | ^~~~ make[2]: *** [CMakeFiles/unitree_mujoco.dir/build.make:115:CMakeFiles/unitree_mujoco.dir/src/mujoco/simulate.cc.o] 错误 1 make[1]: *** [CMakeFiles/Makefile2:134:CMakeFiles/unitree_mujoco.dir/all] 错误 2 make: *** [Makefile:84:all] 错误 2

We have modified the simulate program based on MuJoCo version 3.2.7 and fixed this problem. See: f5b7837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants