Hi,
I have been able to install the development tool chain / environment and build the px4_fmu-v5_default
target successfully from the command line, under the v1.12.0-beta5
git tag.
However, despite the successful build, VS code error highlighting suggests there are problems in calls to the MODULE_NAME
definition as part of px4::WorkItem::WorkItem()
in most module initialization calls.
For example, this occurs within the code snippet from src/modules/mc_rate_control/MulticopterRateControl.cpp
below:
MulticopterRateControl::MulticopterRateControl(bool vtol) :
ModuleParams(nullptr),
WorkItem(MODULE_NAME, px4::wq_configurations::rate_ctrl),
_actuators_0_pub(vtol ? ORB_ID(actuator_controls_virtual_mc) : ORB_ID(actuator_controls_0)),
_loop_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle"))
{
_vehicle_status.vehicle_type = vehicle_status_s::VEHICLE_TYPE_ROTARY_WING;
parameters_updated();
}
The error message here is:
identifier "MODULE_NAME" is undefined C/C++(20)
px4::WorkItem::WorkItem(const char *name, const px4::wq_config_t &config)
+4 overloads
The problem is also highlighted in calls to the px4 logging functions (i.e. PX4_ERR()
and PX4_WARN()
). In this case the error message is:
identifier "MODULE_NAME" is undefined C/C++(20)
#define PX4_WARN(FMT,__VA_ARGS__...) __px4_log_modulename(_PX4_LOG_LEVEL_WARN, FMT, ## __VA_ARGS__)
Expands to:
__px4_log_modulename(_PX4_LOG_LEVEL_WARN, "%s\n",reason)
I believe this is some kind of config problem within the VS code error highlighting or include path settings, but I have not altered the stock configuration.
Does anyone know what might be causing this, or if there is a simple fix that I’m missing?
Thanks for your help,
Robert.