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

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

Open
Crotonbee opened this issue May 11, 2024 · 2 comments
Open

Comments

@Crotonbee
Copy link

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

@hamishwillee
Copy link
Contributor

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>

@Crotonbee
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants