When make px4_sitl_default gazebo, declaration error happens
/home/robin/px4/1.11/Firmware/Tools/sitl_gazebo/src/gazebo_usv_dynamics_plugin.cpp:251:29: error: missing template arguments before ‘xformV’
ignition::math::Matrix4 xformV(vq);
/home/robin/px4/1.11/Firmware/Tools/sitl_gazebo/src/gazebo_usv_dynamics_plugin.cpp:285:15: error: ‘xformV’ was not declared in this scope
bpntW = xformV * bpnt;
Looking into gazebo_usv_dynamics_plugin.cpp, it can be seen that for gazebo version >=8.0 (my Gazebo version is 9.13.0) , the declaration is ignition::math::Matrix4 xformV(vq);, which misses template.
#if GAZEBO_MAJOR_VERSION >= 8
ignition::math::Matrix4 xformV(vq);
#else
ignition::math::Matrix4<double> xformV(vq);
#endif
And when I deleted if-else and changed it to ignition::math::Matrix4<double> xformV(vq);, make px4_sitl_default gazebo passed. So maybe the if-else can be removed.
same issue : https://github.com/PX4/sitl_gazebo/issues/456
Is it the same issue? I have changed a line as mentioned in this and PASSED.
https://discuss.px4.io/t/error-about-gazebo-sitl-building/12019/10
Is it the same issue? I have changed a line as mentioned in this and PASSED.
https://discuss.px4.io/t/error-about-gazebo-sitl-building/12019/10
Yes, it's the same issue. And for the method https://discuss.px4.io/t/error-about-gazebo-sitl-building/12019/10 describes, if-else is useless and it can be removed.