google-deepmind / mujoco_mpc

Real-time behaviour synthesis with MuJoCo, using Predictive Control
https://github.com/deepmind/mujoco_mpc
Apache License 2.0
913 stars 135 forks source link

build error in brace-enclosed initializer list for mjuDef. #239

Closed Rian-Jo closed 6 months ago

Rian-Jo commented 6 months ago

Hi, happy new year.

First of all, I'm the fan of your works. Thank you.

In my computer, i cloned the repository and compiled. Then, when i build, i got the error message for

[build] /mujocompc/mjpc/agent.cc:555:14: error: no match for ‘operator=’ (operand types are ‘mjuiDef’ {aka ‘mjuiDef’} and ‘’) [build] 555 | "0 1"};

and other codes using mjuiDef types.

So i changed from

''' defFeatureParameters[i + parameter_shift] = { mjITEM_SLIDERNUM, "residual", 2, DataAt(ActiveTask()->parameters, i), "0 1" }; '''

to

''' defFeatureParameters[i + parameter_shift] = mjuiDef{ mjITEM_SLIDERNUM, "residual", 2, DataAt(ActiveTask()->parameters, i), "0 1" }; '''

for all cases and worked properly.

Is it correct fix?

thowell commented 6 months ago

What operating system and compiler are you using? I don't see this issue on macOS using clang 14.

Rian-Jo commented 6 months ago

i am using gcc 9.4.0 on Ubuntu 20.04

thowell commented 6 months ago

Try building with clang. You can find additional specifics here.

Rian-Jo commented 6 months ago

I was inteded to use gcc..

ok i'll check. thanks for help!!