DDS - SITL - ‘FS_RADIO’ was not declared in this scope; did you mean ‘FLT_RADIX’

Environment

  • Ubuntu 22.04
  • ROS 2 Humble
  • ArduPilot

I just did a reinstall so all repositories should be up to date.

Following this documentation: ROS 2 — Dev documentation

After these commands:

cd ~/ardu_ws
colcon build --packages-up-to ardupilot_dds_tests --event-handlers=console_cohesion+

I will get this error:

[ 990/3202] Compiling libraries/AP_DDS/AP_DDS_Client.cpp
[1102/3202] Compiling libraries/AP_IRLock/AP_IRLock_I2C.cpp
[1104/3202] Compiling libraries/AP_Motors/AP_Motors_Class.cpp
[1105/3202] Compiling libraries/AP_Motors/AP_MotorsTailsitter.cpp
[1106/3202] Compiling libraries/AP_Motors/AP_MotorsSingle.cpp
[1107/3202] Compiling libraries/AP_Motors/AP_MotorsMatrix_Scripting_Dynamic.cpp
[1108/3202] Compiling libraries/AP_Motors/AP_MotorsMatrix_6DoF_Scripting.cpp
[1109/3202] Compiling libraries/AP_Motors/AP_MotorsHeli_Swash.cpp
[1110/3202] Compiling libraries/AP_Motors/AP_MotorsHeli_RSC.cpp
[1111/3202] Compiling libraries/AP_Motors/AP_MotorsCoax.cpp
[1112/3202] Compiling libraries/AP_Motors/AP_MotorsHeli.cpp
[1113/3202] Compiling libraries/AP_Motors/AP_MotorsHeli_Single.cpp
[1114/3202] Compiling libraries/AP_Motors/AP_MotorsHeli_Dual.cpp
[1115/3202] Compiling libraries/AP_Motors/AP_MotorsHeli_Quad.cpp
[1116/3202] Compiling libraries/AP_Motors/AP_Motors6DOF.cpp
../../libraries/AP_DDS/AP_DDS_Client.cpp: In member function ‘bool AP_DDS_Client::update_topic(ardupilot_msgs_msg_Status&)’:
../../libraries/AP_DDS/AP_DDS_Client.cpp:723:35: error: ‘FS_RADIO’ was not declared in this scope; did you mean ‘FLT_RADIX’?
  723 |         msg.failsafe[fs_iter++] = FS_RADIO;
      |                                   ^~~~~~~~
      |                                   FLT_RADIX
compilation terminated due to -Wfatal-errors.

Waf: Leaving directory `/home/john/ardu_ws/src/ardupilot/build/sitl'
Build failed
 -> task in 'objs/AP_DDS' failed (exit status 1): 
	{task 135222343599040: cxx AP_DDS_Client.cpp -> AP_DDS_Client.cpp.0.o}
 (run with -v to display more information)
gmake[2]: *** [CMakeFiles/ardupilot_build.dir/build.make:70: CMakeFiles/ardupilot_build] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:168: CMakeFiles/ardupilot_build.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
--- stderr: ardupilot_sitl
../../libraries/AP_DDS/AP_DDS_Client.cpp: In member function ‘bool AP_DDS_Client::update_topic(ardupilot_msgs_msg_Status&)’:
../../libraries/AP_DDS/AP_DDS_Client.cpp:723:35: error: ‘FS_RADIO’ was not declared in this scope; did you mean ‘FLT_RADIX’?
  723 |         msg.failsafe[fs_iter++] = FS_RADIO;
      |                                   ^~~~~~~~
      |                                   FLT_RADIX
compilation terminated due to -Wfatal-errors.

Build failed
 -> task in 'objs/AP_DDS' failed (exit status 1): 
	{task 135222343599040: cxx AP_DDS_Client.cpp -> AP_DDS_Client.cpp.0.o}
 (run with -v to display more information)
gmake[2]: *** [CMakeFiles/ardupilot_build.dir/build.make:70: CMakeFiles/ardupilot_build] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:168: CMakeFiles/ardupilot_build.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< ardupilot_sitl [9.77s, exited with code 2]
                                 
Summary: 2 packages finished [11.0s]
  1 package failed: ardupilot_sitl
  1 package had stderr output: ardupilot_sitl
  1 package not processed
john@laptop:~/ardu_ws$ 

I tried this: Compiling Arducopter-4.5.0 with enable-dds failed. But that did not work for me.

How can I solve this?

Same issue for me on clean ubuntu 22 install on current ardupilot master

Full rebuild logs in .txt file (command: colcon build --packages-up-to ardupilot_dds_tests --event-handlers=console_cohesion+ &> build_log.txt)
build_log.txt (158.6 KB)

Noteworthy, the configuration script above makes:

Built target ament_cmake_python_copy_ardupilot_sitl
Setting top to                           : /home/wisnia/ros2-humble/ardu_ws/src/ardupilot 
Setting out to                           : /home/wisnia/ros2-humble/ardu_ws/src/ardupilot/build 
Autoconfiguration                        : enabled 
Checking for program 'python'            : /usr/bin/python3 
running egg_info
creating ardupilot_sitl.egg-info
writing ardupilot_sitl.egg-info/PKG-INFO
writing dependency_links to ardupilot_sitl.egg-info/dependency_links.txt
writing top-level names to ardupilot_sitl.egg-info/top_level.txt
writing manifest file 'ardupilot_sitl.egg-info/SOURCES.txt'
reading manifest file 'ardupilot_sitl.egg-info/SOURCES.txt'
writing manifest file 'ardupilot_sitl.egg-info/SOURCES.txt'
Built target ament_cmake_python_build_ardupilot_sitl_egg
Checking for python version >= 3.6.9     : 3.10.12 
Setting board to                         : sitl 
Using toolchain                          : native 
Checking for 'g++' (C++ compiler)        : /usr/lib/ccache/g++ 
Checking for 'gcc' (C compiler)          : /usr/lib/ccache/gcc 
Checking for c flags '-MMD'              : yes 
Checking for cxx flags '-MMD'            : yes 
CXX Compiler                             : g++ 11.4.0 
Checking for need to link with librt     : not necessary 
Checking for feenableexcept              : yes 
Enabling -Werror                         : yes 
Enabled OpenDroneID                      : no 
Enabled firmware ID checking             : no 
GPS Debug Logging                        : no 
Enabled custom controller                : yes 
Enabled DDS                              : yes 
Checking for HAVE_CMATH_ISFINITE         : yes 
Checking for HAVE_CMATH_ISINF            : yes 
Checking for HAVE_CMATH_ISNAN            : yes 
Checking for NEED_CMATH_ISFINITE_STD_NAMESPACE : yes 
Checking for NEED_CMATH_ISINF_STD_NAMESPACE    : yes 
Checking for NEED_CMATH_ISNAN_STD_NAMESPACE    : yes 
Checking for header endian.h                   : yes 
Checking for header byteswap.h                 : yes 
Checking for HAVE_MEMRCHR                      : yes 
Configured VSCode Intellisense:                : no 
DC_DSDL compiler in                            : /home/wisnia/ros2-humble/ardu_ws/src/ardupilot/modules/DroneCAN/dronecan_dsdlc 
Source is git repository                       : yes 
Update submodules                              : yes 
Checking for program 'git'                     : /usr/bin/git 
Littlefs                                       : disabled 
Checking for program 'size'                    : /usr/bin/size 
Benchmarks                                     : disabled 
Unit tests                                     : enabled 
Scripting                                      : maybe 
Checking for program 'microxrceddsgen'         : /home/wisnia/ros2-humble/ardu_ws/Micro-XRCE-DDS-Gen/scripts/microxrceddsgen 
Scripting runtime checks                       : enabled 
Debug build                                    : disabled 
Coverage build                                 : disabled 
Force 32-bit build                             : disabled 
Checking for program 'rsync'                   : /usr/bin/rsync 
Removing target_list file /home/wisnia/ros2-humble/ardu_ws/src/ardupilot/build/sitl/target_list
'configure' finished successfully (0.361s)
Built target ardupilot_configure

cannot be compiled anymore using basic ./waf copter in ~/ws/src/ardupilot directory serving the same error:

../../libraries/AP_DDS/AP_DDS_Client.cpp: In member function ‘bool AP_DDS_Client::update_topic(ardupilot_msgs_msg_Status&)’:
../../libraries/AP_DDS/AP_DDS_Client.cpp:723:35: error: ‘FS_RADIO’ was not declared in this scope; did you mean ‘FLT_RADIX’?
  723 |         msg.failsafe[fs_iter++] = FS_RADIO;
      |                                   ^~~~~~~~
      |                                   FLT_RADIX
compilation terminated due to -Wfatal-errors.

Waf: Leaving directory `/home/wisnia/ros2-humble/ardu_ws/src/ardupilot/build/sitl'
Build failed
 -> task in 'objs/AP_DDS' failed (exit status 1): 
        {task 140513870770272: cxx AP_DDS_Client.cpp -> AP_DDS_Client.cpp.0.o}
 (run with -v to display more information)

Also, just tried Copter-4.5 and it works… So you might be using latest release…

Running git status in ardupilot dir should answer this question:

~/ardu_ws/src/ardupilot$ git status
On branch Copter-4.5
Your branch is up to date with 'origin/Copter-4.5'.

nothing to commit, working tree clean

Nonetheless some tests DO FAIL but em.. not sure ardupilot is to blame there

anyway the simulation does seem to work:

I’m working on latest version indeed:

~/ardu_ws/src/ardupilot$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

To the development team: Latest version should work right? What can we do in order to run without errors?

We’re fixing it this week, sorry for the trouble.

This needs to get folded into our CI docker images and then people.

For now, go into your MicroXrceDDSGen and run git pull.

Is the fix for this issues merged? I have pulled the recent code in MicroXrceDDSGen and it has this commit b884005 (HEAD -> master, origin/master, origin/HEAD) Patch for code gen and failing checks 92d03c8 Updated C-style global constant naming but I am still facing this issue ‘FS_RADIO’ was not declared in this scope; did you mean ‘FLT_RADIX’.

Also pull in this patch to ardupilot.

We’re working on modifying the docker infrastructure in ardupilot_dev_docker to support versioning.

hi there,

i did same thing , i pulled copter 4.5 , it compiles and builds it. once i tryna run ros_gz bringup it fails to build. show up the same error.

to ardupilot_gz_bringup
Starting >>> ardupilot_gazebo
Starting >>> ardupilot_msgs
Starting >>> micro_ros_agent
Starting >>> ros_gz_interfaces
Starting >>> sdformat_test_files
Starting >>> ardupilot_gz_description
Starting >>> ardupilot_gz_gazebo
Starting >>> ros_gz_sim
Finished <<< sdformat_test_files [0.06s]
Finished <<< ardupilot_gz_description [0.07s]
Starting >>> sdformat_urdf
Finished <<< micro_ros_agent [0.09s]
Finished <<< ardupilot_gazebo [0.11s]
Finished <<< ardupilot_gz_gazebo [0.10s]
Starting >>> ardupilot_sitl_models
Finished <<< ros_gz_sim [0.12s]
Finished <<< ardupilot_sitl_models [0.05s]
Finished <<< sdformat_urdf [0.10s]
Finished <<< ardupilot_msgs [0.33s]
Starting >>> ardupilot_sitl
Finished <<< ros_gz_interfaces [0.33s]
Starting >>> ros_gz_bridge
Finished <<< ros_gz_bridge [0.09s]
— stderr: ardupilot_sitl
../../libraries/AP_DDS/AP_DDS_Client.cpp: In member function ‘bool AP_DDS_Client::update_topic(ardupilot_msgs_msg_Status&)’:
../../libraries/AP_DDS/AP_DDS_Client.cpp:723:35: error: ‘FS_RADIO’ was not declared in this scope; did you mean ‘Status::FS_RADIO’?
723 | msg.failsafe[fs_iter++] = FS_RADIO;
| ^~~~~~~~
| Status::FS_RADIO
compilation terminated due to -Wfatal-errors.

Build failed
→ task in ‘objs/AP_DDS’ failed (exit status 1):
{task 123642790189248: cxx AP_DDS_Client.cpp → AP_DDS_Client.cpp.0.o}
(run with -v to display more information)
gmake[2]: *** [CMakeFiles/ardupilot_build.dir/build.make:70: CMakeFiles/ardupilot_build] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:168: CMakeFiles/ardupilot_build.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Failed <<< ardupilot_sitl [5.86s, exited with code 2]

Summary: 11 packages finished [6.59s]
1 package failed: ardupilot_sitl
1 package had stderr output: ardupilot_sitl
1 package not processed

i did try to pull a different version of ros_gz packages still throw up error.
what should i do here ?
help me please.

thanks in advance

Hi, any news yet? I also tried it with the changes of this patch, did not work.

Please just use master of ardupilot with this tag of MicroXRCEDDSGen.

OR
Pull in the patch I linked two posts ago and use master of Micro-XRCE-DDS-Gen.

You must select one of these till we get CI supporting tagged images.

2 Likes

Looks like its working. Thanks!

Hi, so sorry I ran into this same issue with FS_RADIO, I am using the master branch for ardupilot, however I am unsure how to use the v4.5.1 release of Micro-XRCE-DDS-Gen. Could anyone guide me through this? Thank you so much!

Hi, after switching to v4.5.1. release, did you again ran the ./gradlew assemble command?

Hi!
Ran into the same problem. Using:

  • ardupilot master branch.
  • Micro-XRCE-DDS-Gen branch v4.5.1

After ./gradlew assemble I have this error on colcon build

Starting >>> ardupilot_sitl
--- stderr: ardupilot_sitl
../../libraries/AP_DDS/AP_DDS_Client.cpp: In member function ‘bool AP_DDS_Client::update_topic(ardupilot_msgs_msg_Status&)’:
../../libraries/AP_DDS/AP_DDS_Client.cpp:723:35: error: ‘FS_RADIO’ was not declared in this scope; did you mean ‘Status::FS_RADIO’?
723 | msg.failsafe[fs_iter++] = FS_RADIO;
| ^~~~~~~~ 
| Status::FS_RADIO
compilation terminated due to -Wfatal-errors.

Build failed 
-> task in 'objs/AP_DDS' failed (exit status 1): 
{task 131436372308512: cxx AP_DDS_Client.cpp -> AP_DDS_Client.cpp.0.o} 
(run with -v to display more information)
gmake[2]: *** [CMakeFiles/ardupilot_build.dir/build.make:70: CMakeFiles/ardupilot_build] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:168: CMakeFiles/ardupilot_build.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Are you sure this is the only MicroXRCEDDSGen repo you have on your system?

Type which microxrceddsgen to figure out where the path is.

This is now resolved; just updating docs now.

2 Likes

That’s great news. I will try later.