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

Error Code 1&2 gps_cpp.o ? Catkin Build : Ubuntu 20.04 Ros Neotic Mavros install #1938

Open
agtekrobotics opened this issue Mar 15, 2024 · 5 comments

Comments

@agtekrobotics
Copy link

This is only bug and feature tracker, please use it
to report bugs or request features.


Issue details

When trying to install mavros I am having issues with catkin build in the catkin_ws

More specifically the issue is with the mavros_extras package relating to the gps_status.cpp

MAVROS version and platform

Mavros: 1.18.0
ROS: Noetic
Ubuntu: 20.04

Catkin build logs below:

Errors << mavros_extras:make /home/admin/catkin_ws/logs/mavros_extras/build.make.006.log
/home/admin/catkin_ws/src/mavros/mavros_extras/src/plugins/gps_status.cpp: In member function ‘void mavros::extra_plugins::GpsStatusPlugin::handle_gps2_raw(const mavlink_message_t*, mavlink::common::msg::GPS2_RAW&)’:
/home/admin/catkin_ws/src/mavros/mavros_extras/src/plugins/gps_status.cpp:107:40: error: ‘struct mavlink::common::msg::GPS2_RAW’ has no member named ‘alt_ellipsoid’
107 | ros_msg->alt_ellipsoid = mav_msg.alt_ellipsoid;
| ^~~~~~~~~~~~~
/home/admin/catkin_ws/src/mavros/mavros_extras/src/plugins/gps_status.cpp:108:40: error: ‘struct mavlink::common::msg::GPS2_RAW’ has no member named ‘h_acc’
108 | ros_msg->h_acc = mav_msg.h_acc;
| ^~~~~
/home/admin/catkin_ws/src/mavros/mavros_extras/src/plugins/gps_status.cpp:109:40: error: ‘struct mavlink::common::msg::GPS2_RAW’ has no member named ‘v_acc’
109 | ros_msg->v_acc = mav_msg.v_acc;
| ^~~~~
/home/admin/catkin_ws/src/mavros/mavros_extras/src/plugins/gps_status.cpp:110:40: error: ‘struct mavlink::common::msg::GPS2_RAW’ has no member named ‘vel_acc’
110 | ros_msg->vel_acc = mav_msg.vel_acc;
| ^~~~~~~
/home/admin/catkin_ws/src/mavros/mavros_extras/src/plugins/gps_status.cpp:111:40: error: ‘struct mavlink::common::msg::GPS2_RAW’ has no member named ‘hdg_acc’
111 | ros_msg->hdg_acc = mav_msg.hdg_acc;
| ^~~~~~~
make[2]: *** [CMakeFiles/mavros_extras.dir/build.make:232: CMakeFiles/mavros_extras.dir/src/plugins/gps_status.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:735: CMakeFiles/mavros_extras.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
cd /home/admin/catkin_ws/build/mavros_extras; catkin build --get-env mavros_extras | catkin env -si /usr/bin/make --jobserver-auth=3,4; cd -

could anyone please help

installation I have followed: https://github.com/mavlink/mavros/tree/master/mavros#installation

@agtekrobotics agtekrobotics changed the title Catkin Build : Ubuntu 20.04 Ros Neotic Mavros isntall Catkin Build : Ubuntu 20.04 Ros Neotic Mavros install Mar 15, 2024
@agtekrobotics agtekrobotics changed the title Catkin Build : Ubuntu 20.04 Ros Neotic Mavros install Error Code 1&2 gps_cpp.o ? Catkin Build : Ubuntu 20.04 Ros Neotic Mavros install Mar 15, 2024
@bwh1270
Copy link

bwh1270 commented Apr 1, 2024

I encountered the same error while building during MAVROS source installation.
Upon inspecting the gps_status.cpp file, it seemed that GPS_RAW and GPS_RAW2 had the same fields.
So, I added the missing field to GPS2_RAW in the mavlink/message_definitions/v1.0/common.xml file, and the issue was resolved.

The code I added to GPS2_RAW with id=124 in the common.xml file is as follows:

<message id="124" name="GPS2_RAW">
      <description>Second GPS data.</description>
      ...
      <extensions/>
      <field type="int32_t" name="alt_ellipsoid" units="mm">Altitude (above WGS84, EGM96 ellipsoid). Positive for up.</field>
      <field type="uint32_t" name="h_acc" units="mm">Position uncertainty.</field>
      <field type="uint32_t" name="v_acc" units="mm">Altitude uncertainty.</field>
      <field type="uint32_t" name="vel_acc" units="mm">Speed uncertainty.</field>
      <field type="uint32_t" name="hdg_acc" units="degE5">Heading / track uncertainty</field>
      <field type="uint16_t" name="yaw" units="cdeg">Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use 65535 if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.</field>
</message>
...

@guiaugustoga987
Copy link

I encountered the same error while building during MAVROS source installation. Upon inspecting the gps_status.cpp file, it seemed that GPS_RAW and GPS_RAW2 had the same fields. So, I added the missing field to GPS2_RAW in the mavlink/message_definitions/v1.0/common.xml file, and the issue was resolved.

The code I added to GPS2_RAW with id=124 in the common.xml file is as follows:

<message id="124" name="GPS2_RAW">
      <description>Second GPS data.</description>
      ...
      <extensions/>
      <field type="int32_t" name="alt_ellipsoid" units="mm">Altitude (above WGS84, EGM96 ellipsoid). Positive for up.</field>
      <field type="uint32_t" name="h_acc" units="mm">Position uncertainty.</field>
      <field type="uint32_t" name="v_acc" units="mm">Altitude uncertainty.</field>
      <field type="uint32_t" name="vel_acc" units="mm">Speed uncertainty.</field>
      <field type="uint32_t" name="hdg_acc" units="degE5">Heading / track uncertainty</field>
      <field type="uint16_t" name="yaw" units="cdeg">Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use 65535 if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.</field>
</message>
...

After I did this change I got the following error :


make[2]: *** [CMakeFiles/paparazzi.xml-v2.0.dir/build.make:63: paparazzi-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:145: CMakeFiles/paparazzi.xml-v2.0.dir/all] Erro 2
make[1]: ** Esperando que outros processos terminem.
make[2]: *** [CMakeFiles/ualberta.xml-v2.0.dir/build.make:63: ualberta-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:289: CMakeFiles/ualberta.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/standard.xml-v2.0.dir/build.make:63: standard-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/standard.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/ASLUAV.xml-v2.0.dir/build.make:63: ASLUAV-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:640: CMakeFiles/ASLUAV.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/uAvionix.xml-v2.0.dir/build.make:63: uAvionix-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:343: CMakeFiles/uAvionix.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/matrixpilot.xml-v2.0.dir/build.make:63: matrixpilot-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:397: CMakeFiles/matrixpilot.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/autoquad.xml-v2.0.dir/build.make:63: autoquad-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:235: CMakeFiles/autoquad.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/ardupilotmega.xml-v2.0.dir/build.make:63: ardupilotmega-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:262: CMakeFiles/ardupilotmega.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/all.xml-v2.0.dir/build.make:63: all-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:694: CMakeFiles/all.xml-v2.0.dir/all] Erro 2
make: *** [Makefile:118: all] Erro 2

How can I solve it ?

@vooon
Copy link
Member

vooon commented Jul 4, 2024

Try to remove build dir.

@GabrielWellander
Copy link

GabrielWellander commented Jul 16, 2024

I encountered the same error while building during MAVROS source installation. Upon inspecting the gps_status.cpp file, it seemed that GPS_RAW and GPS_RAW2 had the same fields. So, I added the missing field to GPS2_RAW in the mavlink/message_definitions/v1.0/common.xml file, and the issue was resolved.
The code I added to GPS2_RAW with id=124 in the common.xml file is as follows:

<message id="124" name="GPS2_RAW">
      <description>Second GPS data.</description>
      ...
      <extensions/>
      <field type="int32_t" name="alt_ellipsoid" units="mm">Altitude (above WGS84, EGM96 ellipsoid). Positive for up.</field>
      <field type="uint32_t" name="h_acc" units="mm">Position uncertainty.</field>
      <field type="uint32_t" name="v_acc" units="mm">Altitude uncertainty.</field>
      <field type="uint32_t" name="vel_acc" units="mm">Speed uncertainty.</field>
      <field type="uint32_t" name="hdg_acc" units="degE5">Heading / track uncertainty</field>
      <field type="uint16_t" name="yaw" units="cdeg">Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use 65535 if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.</field>
</message>
...

After I did this change I got the following error :


make[2]: *** [CMakeFiles/paparazzi.xml-v2.0.dir/build.make:63: paparazzi-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:145: CMakeFiles/paparazzi.xml-v2.0.dir/all] Erro 2
make[1]: ** Esperando que outros processos terminem.
make[2]: *** [CMakeFiles/ualberta.xml-v2.0.dir/build.make:63: ualberta-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:289: CMakeFiles/ualberta.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/standard.xml-v2.0.dir/build.make:63: standard-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/standard.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/ASLUAV.xml-v2.0.dir/build.make:63: ASLUAV-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:640: CMakeFiles/ASLUAV.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/uAvionix.xml-v2.0.dir/build.make:63: uAvionix-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:343: CMakeFiles/uAvionix.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/matrixpilot.xml-v2.0.dir/build.make:63: matrixpilot-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:397: CMakeFiles/matrixpilot.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/autoquad.xml-v2.0.dir/build.make:63: autoquad-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:235: CMakeFiles/autoquad.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/ardupilotmega.xml-v2.0.dir/build.make:63: ardupilotmega-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:262: CMakeFiles/ardupilotmega.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/all.xml-v2.0.dir/build.make:63: all-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:694: CMakeFiles/all.xml-v2.0.dir/all] Erro 2
make: *** [Makefile:118: all] Erro 2

How can I solve it ?

I've got the same issue and a
catkin clean -y
did not work to solve my issue.

The error message I got
make[2]: *** [CMakeFiles/standard.xml-v2.0.dir/build.make:63: standard-v2.0-cxx-stamp] Error 1 make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/standard.xml-v2.0.dir/all] Error 2 make: *** [Makefile:118: all] Error 2

@Wangben1019
Copy link

我在 MAVROS 源安装过程中构建时遇到了同样的错误。检查 gps_status.cpp 文件后发现,GPS_RAW 和 GPS_RAW2 似乎具有相同的字段。因此,我在 mavlink/message_definitions/v1.0/common.xml 文件中将缺失的字段添加到 GPS2_RAW,问题得到解决。
我在 common.xml 文件中 id=124 的 GPS2_RAW 中添加的代码如下:

<message id="124" name="GPS2_RAW">
      <description>Second GPS data.</description>
      ...
      <extensions/>
      <field type="int32_t" name="alt_ellipsoid" units="mm">Altitude (above WGS84, EGM96 ellipsoid). Positive for up.</field>
      <field type="uint32_t" name="h_acc" units="mm">Position uncertainty.</field>
      <field type="uint32_t" name="v_acc" units="mm">Altitude uncertainty.</field>
      <field type="uint32_t" name="vel_acc" units="mm">Speed uncertainty.</field>
      <field type="uint32_t" name="hdg_acc" units="degE5">Heading / track uncertainty</field>
      <field type="uint16_t" name="yaw" units="cdeg">Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use 65535 if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.</field>
</message>
...

完成此更改后,出现以下错误:


make[2]: *** [CMakeFiles/paparazzi.xml-v2.0.dir/build.make:63: paparazzi-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:145: CMakeFiles/paparazzi.xml-v2.0.dir/all] Erro 2
make[1]: ** Esperando que outros processos terminem.
make[2]: *** [CMakeFiles/ualberta.xml-v2.0.dir/build.make:63: ualberta-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:289: CMakeFiles/ualberta.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/standard.xml-v2.0.dir/build.make:63: standard-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/standard.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/ASLUAV.xml-v2.0.dir/build.make:63: ASLUAV-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:640: CMakeFiles/ASLUAV.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/uAvionix.xml-v2.0.dir/build.make:63: uAvionix-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:343: CMakeFiles/uAvionix.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/matrixpilot.xml-v2.0.dir/build.make:63: matrixpilot-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:397: CMakeFiles/matrixpilot.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/autoquad.xml-v2.0.dir/build.make:63: autoquad-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:235: CMakeFiles/autoquad.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/ardupilotmega.xml-v2.0.dir/build.make:63: ardupilotmega-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:262: CMakeFiles/ardupilotmega.xml-v2.0.dir/all] Erro 2
make[2]: *** [CMakeFiles/all.xml-v2.0.dir/build.make:63: all-v2.0-cxx-stamp] Erro 1
make[1]: *** [CMakeFiles/Makefile2:694: CMakeFiles/all.xml-v2.0.dir/all] Erro 2
make: *** [Makefile:118: all] Erro 2

我该如何解决它?

我遇到了同样的问题,但 catkin clean -y 没有解决我的问题。

我收到的错误消息 make[2]: *** [CMakeFiles/standard.xml-v2.0.dir/build.make:63: standard-v2.0-cxx-stamp] Error 1 make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/standard.xml-v2.0.dir/all] Error 2 make: *** [Makefile:118: all] Error 2

I think you should recheck your common.xml because the solution provided by bwh1270 cannot be directly copied and pasted. He provided context to facilitate locating and changing the location

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

6 participants