PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

[Bug] __orb_trajectory_setpoint</b>’ was not declared in this scope

Open Crotonbee opened this issue 1 year ago • 2 comments

Describe the bug

Hi,I have written a code with PX4 1.14 to do a simulation on gazebo,like this: uORB::Publication<vehicle_local_position_setpoint_s> _trajectory_setpoint_pub{ORB_ID(trajectory_setpoint)};

To Reproduce

but it suported a mistake:‘__orb_trajectory_setpoint’ was not declared in this scope; did you mean ‘__orb_position_setpoint’? but if I run this code with 1.13,it works well

Expected behavior

So how should I use trajectory_setpoint in 1.14?Thanks!

Screenshot / Media

No response

Flight Log

In file included from ../../platforms/common/uORB/Subscription.hpp:41,
from ../../src/modules/control_node/control_node.h:5,
from ../../src/modules/control_node/control_node.cpp:1:
../../platforms/common/uORB/uORB.h:80:25: error: __orb_trajectory_setpoint’ was not declared in this scope; did you mean ‘__orb_position_setpoint’?
80 | #define ORB_ID(_name)  &_orb##_name
|                         ^~
../../src/modules/control_node/control_node.h:83:86: note: in expansion of macro ‘ORB_ID’
83 |        uORB::Publication _trajectory_setpoint_pub{ORB_ID(trajectory_setpoint)};
|                                                                                      ^~
compilation terminated due to -Wfatal-errors.
[3/471] Building CXX object src/module...es/modules__ekf2.dir/EKF/control.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:227: px4_sitl_default] Error 1

Software Version

1.14

Flight controller

Nxt-dual

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

No response

Crotonbee avatar May 11 '24 17:05 Crotonbee

Not an expert but src/modules/control_node/control_node.h does not appear to be part of PX4 code, so it is hard to know what it includes or does not include.

See if the following line is somewhere in your include path: #include <uORB/topics/trajectory_setpoint.h>

hamishwillee avatar May 15 '24 01:05 hamishwillee

Not an expert but src/modules/control_node/control_node.h does not appear to be part of PX4 code, so it is hard to know what it includes or does not include.

See if the following line is somewhere in your include path: #include <uORB/topics/trajectory_setpoint.h>

Thank you very much for your help! The problem has been solved

Crotonbee avatar May 15 '24 13:05 Crotonbee