micro-ROS / micro_ros_raspberrypi_pico_sdk

Raspberry Pi Pico (RP2040) and micro-ROS integration
Apache License 2.0
179 stars 52 forks source link

Fix clockid_t compile error (backport #1195) #1198

Closed mergify[bot] closed 3 months ago

mergify[bot] commented 3 months ago

I was having compile errors when running make:

/home/will/Desktop/micro-ros-project/micro_ros_raspberrypi_pico_sdk/pico_uart_transport.c:11:19: error: unknown type name 'clockid_t'
   11 | int clock_gettime(clockid_t unused, struct timespec *tp)
      |                   ^~~~~~~~~
make[2]: *** [CMakeFiles/micro-ros-project.dir/build.make:90: CMakeFiles/micro-ros-project.dir/micro_ros_raspberrypi_pico_sdk/pico_uart_transport.c.obj] Error 1

I found that I needed to add #include <time.h> in pico_uart_transport.c.

I am compiling on a Raspberry Pi 5 running Ubuntu 24.04 LTS with ROS2 Jazzy.


This is an automatic backport of pull request #1195 done by Mergify.