2016-05-16 04:22:34 -03:00
|
|
|
############################################################################
|
|
|
|
#
|
2022-10-19 20:36:47 -03:00
|
|
|
# Copyright (c) 2016-2022 PX4 Development Team. All rights reserved.
|
2016-05-16 04:22:34 -03:00
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name PX4 nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2019-11-22 08:48:09 -04:00
|
|
|
# Support IN_LIST if() operator
|
|
|
|
cmake_policy(SET CMP0057 NEW)
|
|
|
|
|
2021-05-05 06:09:28 -03:00
|
|
|
include(px4_list_make_absolute)
|
|
|
|
|
2017-09-25 19:00:59 -03:00
|
|
|
set(msg_files
|
2022-10-19 20:36:47 -03:00
|
|
|
ActionRequest.msg
|
|
|
|
ActuatorArmed.msg
|
|
|
|
ActuatorControls.msg
|
|
|
|
ActuatorControlsStatus.msg
|
|
|
|
ActuatorMotors.msg
|
|
|
|
ActuatorOutputs.msg
|
|
|
|
ActuatorServos.msg
|
|
|
|
ActuatorServosTrim.msg
|
|
|
|
ActuatorTest.msg
|
|
|
|
AdcReport.msg
|
|
|
|
Airspeed.msg
|
|
|
|
AirspeedValidated.msg
|
|
|
|
AirspeedWind.msg
|
|
|
|
AutotuneAttitudeControlStatus.msg
|
|
|
|
BatteryStatus.msg
|
|
|
|
ButtonEvent.msg
|
|
|
|
CameraCapture.msg
|
|
|
|
CameraStatus.msg
|
|
|
|
CameraTrigger.msg
|
|
|
|
CellularStatus.msg
|
|
|
|
CollisionConstraints.msg
|
|
|
|
CollisionReport.msg
|
|
|
|
ControlAllocatorStatus.msg
|
|
|
|
Cpuload.msg
|
|
|
|
DebugArray.msg
|
|
|
|
DebugKeyValue.msg
|
|
|
|
DebugValue.msg
|
|
|
|
DebugVect.msg
|
|
|
|
DifferentialPressure.msg
|
|
|
|
DistanceSensor.msg
|
|
|
|
Ekf2Timestamps.msg
|
|
|
|
EscReport.msg
|
|
|
|
EscStatus.msg
|
|
|
|
EstimatorAidSource1d.msg
|
|
|
|
EstimatorAidSource2d.msg
|
|
|
|
EstimatorAidSource3d.msg
|
|
|
|
EstimatorBias.msg
|
2022-12-20 11:23:56 -04:00
|
|
|
EstimatorBias3d.msg
|
2022-10-19 20:36:47 -03:00
|
|
|
EstimatorEventFlags.msg
|
|
|
|
EstimatorGpsStatus.msg
|
|
|
|
EstimatorInnovations.msg
|
|
|
|
EstimatorSelectorStatus.msg
|
|
|
|
EstimatorSensorBias.msg
|
|
|
|
EstimatorStates.msg
|
|
|
|
EstimatorStatus.msg
|
|
|
|
EstimatorStatusFlags.msg
|
|
|
|
Event.msg
|
|
|
|
FailsafeFlags.msg
|
|
|
|
FailureDetectorStatus.msg
|
|
|
|
FollowTarget.msg
|
|
|
|
FollowTargetEstimator.msg
|
|
|
|
FollowTargetStatus.msg
|
|
|
|
GeneratorStatus.msg
|
|
|
|
GeofenceResult.msg
|
|
|
|
GimbalDeviceAttitudeStatus.msg
|
|
|
|
GimbalDeviceInformation.msg
|
|
|
|
GimbalDeviceSetAttitude.msg
|
|
|
|
GimbalManagerInformation.msg
|
|
|
|
GimbalManagerSetAttitude.msg
|
|
|
|
GimbalManagerSetManualControl.msg
|
|
|
|
GimbalManagerStatus.msg
|
|
|
|
GpsDump.msg
|
|
|
|
GpsInjectData.msg
|
|
|
|
Gripper.msg
|
|
|
|
HealthReport.msg
|
|
|
|
HeaterStatus.msg
|
|
|
|
HomePosition.msg
|
|
|
|
HoverThrustEstimate.msg
|
|
|
|
InputRc.msg
|
|
|
|
InternalCombustionEngineStatus.msg
|
|
|
|
IridiumsbdStatus.msg
|
|
|
|
IrlockReport.msg
|
|
|
|
LandingGear.msg
|
2022-10-31 12:56:20 -03:00
|
|
|
LandingGearWheel.msg
|
2022-10-19 20:36:47 -03:00
|
|
|
LandingTargetInnovations.msg
|
|
|
|
LandingTargetPose.msg
|
2022-11-04 08:04:55 -03:00
|
|
|
LaunchDetectionStatus.msg
|
2022-10-19 20:36:47 -03:00
|
|
|
LedControl.msg
|
|
|
|
LoggerStatus.msg
|
|
|
|
LogMessage.msg
|
|
|
|
MagnetometerBiasEstimate.msg
|
|
|
|
MagWorkerData.msg
|
|
|
|
ManualControlSetpoint.msg
|
|
|
|
ManualControlSwitches.msg
|
|
|
|
MavlinkLog.msg
|
|
|
|
MavlinkTunnel.msg
|
|
|
|
Mission.msg
|
|
|
|
MissionResult.msg
|
|
|
|
MountOrientation.msg
|
|
|
|
NavigatorMissionItem.msg
|
|
|
|
NpfgStatus.msg
|
|
|
|
ObstacleDistance.msg
|
|
|
|
OffboardControlMode.msg
|
|
|
|
OnboardComputerStatus.msg
|
|
|
|
OrbitStatus.msg
|
|
|
|
OrbTest.msg
|
|
|
|
OrbTestLarge.msg
|
|
|
|
OrbTestMedium.msg
|
|
|
|
ParameterUpdate.msg
|
|
|
|
Ping.msg
|
|
|
|
PositionControllerLandingStatus.msg
|
|
|
|
PositionControllerStatus.msg
|
|
|
|
PositionSetpoint.msg
|
|
|
|
PositionSetpointTriplet.msg
|
|
|
|
PowerButtonState.msg
|
|
|
|
PowerMonitor.msg
|
|
|
|
PpsCapture.msg
|
|
|
|
PwmInput.msg
|
|
|
|
Px4ioStatus.msg
|
2022-12-09 17:49:41 -04:00
|
|
|
QshellReq.msg
|
|
|
|
QshellRetval.msg
|
2022-10-19 20:36:47 -03:00
|
|
|
RadioStatus.msg
|
|
|
|
RateCtrlStatus.msg
|
|
|
|
RcChannels.msg
|
|
|
|
RcParameterMap.msg
|
|
|
|
Rpm.msg
|
|
|
|
RtlTimeEstimate.msg
|
|
|
|
SatelliteInfo.msg
|
|
|
|
SensorAccel.msg
|
|
|
|
SensorAccelFifo.msg
|
|
|
|
SensorBaro.msg
|
|
|
|
SensorCombined.msg
|
|
|
|
SensorCorrection.msg
|
|
|
|
SensorGnssRelative.msg
|
|
|
|
SensorGps.msg
|
|
|
|
SensorGyro.msg
|
|
|
|
SensorGyroFft.msg
|
|
|
|
SensorGyroFifo.msg
|
|
|
|
SensorHygrometer.msg
|
|
|
|
SensorMag.msg
|
|
|
|
SensorOpticalFlow.msg
|
|
|
|
SensorPreflightMag.msg
|
|
|
|
SensorSelection.msg
|
|
|
|
SensorsStatus.msg
|
|
|
|
SensorsStatusImu.msg
|
|
|
|
SystemPower.msg
|
|
|
|
TakeoffStatus.msg
|
|
|
|
TaskStackInfo.msg
|
|
|
|
TecsStatus.msg
|
|
|
|
TelemetryStatus.msg
|
|
|
|
TimesyncStatus.msg
|
|
|
|
TrajectoryBezier.msg
|
|
|
|
TrajectorySetpoint.msg
|
|
|
|
TrajectoryWaypoint.msg
|
|
|
|
TransponderReport.msg
|
|
|
|
TuneControl.msg
|
|
|
|
UavcanParameterRequest.msg
|
|
|
|
UavcanParameterValue.msg
|
|
|
|
UlogStream.msg
|
|
|
|
UlogStreamAck.msg
|
|
|
|
UwbDistance.msg
|
|
|
|
UwbGrid.msg
|
|
|
|
VehicleAcceleration.msg
|
|
|
|
VehicleAirData.msg
|
|
|
|
VehicleAngularAccelerationSetpoint.msg
|
|
|
|
VehicleAngularVelocity.msg
|
|
|
|
VehicleAttitude.msg
|
|
|
|
VehicleAttitudeSetpoint.msg
|
|
|
|
VehicleCommand.msg
|
|
|
|
VehicleCommandAck.msg
|
|
|
|
VehicleConstraints.msg
|
|
|
|
VehicleControlMode.msg
|
|
|
|
VehicleGlobalPosition.msg
|
|
|
|
VehicleImu.msg
|
|
|
|
VehicleImuStatus.msg
|
|
|
|
VehicleLandDetected.msg
|
|
|
|
VehicleLocalPosition.msg
|
|
|
|
VehicleLocalPositionSetpoint.msg
|
|
|
|
VehicleMagnetometer.msg
|
|
|
|
VehicleOdometry.msg
|
|
|
|
VehicleOpticalFlow.msg
|
|
|
|
VehicleOpticalFlowVel.msg
|
|
|
|
VehicleRatesSetpoint.msg
|
|
|
|
VehicleRoi.msg
|
|
|
|
VehicleStatus.msg
|
|
|
|
VehicleThrustSetpoint.msg
|
|
|
|
VehicleTorqueSetpoint.msg
|
|
|
|
VehicleTrajectoryBezier.msg
|
|
|
|
VehicleTrajectoryWaypoint.msg
|
|
|
|
VtolVehicleStatus.msg
|
|
|
|
WheelEncoders.msg
|
|
|
|
Wind.msg
|
|
|
|
YawEstimatorStatus.msg
|
2020-01-18 02:15:00 -04:00
|
|
|
)
|
2020-10-19 13:35:48 -03:00
|
|
|
list(SORT msg_files)
|
|
|
|
|
2021-05-05 06:09:28 -03:00
|
|
|
px4_list_make_absolute(msg_files ${CMAKE_CURRENT_SOURCE_DIR} ${msg_files})
|
|
|
|
|
2018-03-13 19:40:38 -03:00
|
|
|
if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
|
|
|
|
# Check that the msg directory and the CMakeLists.txt file exists
|
|
|
|
if(EXISTS ${EXTERNAL_MODULES_LOCATION}/msg/CMakeLists.txt)
|
|
|
|
add_subdirectory(${EXTERNAL_MODULES_LOCATION}/msg external_msg)
|
|
|
|
|
|
|
|
# Add each of the external message files to the global msg_files list
|
|
|
|
foreach(external_msg_file ${config_msg_list_external})
|
|
|
|
list(APPEND msg_files ${EXTERNAL_MODULES_LOCATION}/msg/${external_msg_file})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2017-09-25 19:00:59 -03:00
|
|
|
# headers
|
|
|
|
set(msg_out_path ${PX4_BINARY_DIR}/uORB/topics)
|
2022-02-11 12:11:34 -04:00
|
|
|
set(ucdr_out_path ${PX4_BINARY_DIR}/uORB/ucdr)
|
2022-10-19 20:36:47 -03:00
|
|
|
set(msg_source_out_path ${CMAKE_CURRENT_BINARY_DIR}/topics_sources)
|
2017-09-25 19:00:59 -03:00
|
|
|
|
2022-10-19 20:36:47 -03:00
|
|
|
set(uorb_headers)
|
|
|
|
set(uorb_sources)
|
2022-02-11 12:11:34 -04:00
|
|
|
set(uorb_ucdr_headers)
|
2017-09-25 19:00:59 -03:00
|
|
|
foreach(msg_file ${msg_files})
|
|
|
|
get_filename_component(msg ${msg_file} NAME_WE)
|
2022-10-19 20:36:47 -03:00
|
|
|
|
|
|
|
# Pascal case to snake case (MsgFile -> msg_file)
|
|
|
|
string(REGEX REPLACE "(.)([A-Z][a-z]+)" "\\1_\\2" msg "${msg}")
|
|
|
|
string(REGEX REPLACE "([a-z0-9])([A-Z])" "\\1_\\2" msg "${msg}")
|
|
|
|
string(TOLOWER "${msg}" msg)
|
|
|
|
|
2017-09-25 19:00:59 -03:00
|
|
|
list(APPEND uorb_headers ${msg_out_path}/${msg}.h)
|
|
|
|
list(APPEND uorb_sources ${msg_source_out_path}/${msg}.cpp)
|
2022-02-11 12:11:34 -04:00
|
|
|
list(APPEND uorb_ucdr_headers ${ucdr_out_path}/${msg}.h)
|
2016-05-16 04:22:34 -03:00
|
|
|
endforeach()
|
|
|
|
|
2020-10-19 14:08:34 -03:00
|
|
|
# set parent scope msg_files for other modules to consume (eg topic_listener)
|
|
|
|
set(msg_files ${msg_files} PARENT_SCOPE)
|
|
|
|
|
2017-09-25 19:00:59 -03:00
|
|
|
# Generate uORB headers
|
2022-10-19 20:36:47 -03:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
${uorb_headers}
|
|
|
|
${msg_out_path}/uORBTopics.hpp
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/msg/px_generate_uorb_topic_files.py
|
2017-09-25 19:00:59 -03:00
|
|
|
--headers
|
|
|
|
-f ${msg_files}
|
|
|
|
-i ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
-o ${msg_out_path}
|
2022-10-19 20:36:47 -03:00
|
|
|
-e ${PX4_SOURCE_DIR}/Tools/msg/templates/uorb
|
2018-03-27 13:19:04 -03:00
|
|
|
DEPENDS
|
|
|
|
${msg_files}
|
2022-10-19 20:36:47 -03:00
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/templates/uorb/msg.h.em
|
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/templates/uorb/uORBTopics.hpp.em
|
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/px_generate_uorb_topic_files.py
|
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/px_generate_uorb_topic_helper.py
|
2017-09-25 19:00:59 -03:00
|
|
|
COMMENT "Generating uORB topic headers"
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
add_custom_target(uorb_headers DEPENDS ${uorb_headers})
|
2017-01-13 11:43:48 -04:00
|
|
|
|
2022-10-19 20:36:47 -03:00
|
|
|
# Generate microcdr headers
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${uorb_ucdr_headers}
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/msg/px_generate_uorb_topic_files.py
|
2022-02-11 12:11:34 -04:00
|
|
|
--headers
|
|
|
|
-f ${msg_files}
|
|
|
|
-i ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
-o ${ucdr_out_path}
|
2022-10-19 20:36:47 -03:00
|
|
|
-e ${PX4_SOURCE_DIR}/Tools/msg/templates/ucdr
|
2022-02-11 12:11:34 -04:00
|
|
|
DEPENDS
|
|
|
|
${msg_files}
|
2022-10-19 20:36:47 -03:00
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/templates/ucdr/msg.h.em
|
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/px_generate_uorb_topic_files.py
|
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/px_generate_uorb_topic_helper.py
|
2022-02-11 12:11:34 -04:00
|
|
|
COMMENT "Generating uORB topic ucdr headers"
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
add_custom_target(uorb_ucdr_headers DEPENDS ${uorb_ucdr_headers})
|
|
|
|
|
2017-09-25 19:00:59 -03:00
|
|
|
# Generate uORB sources
|
2022-10-19 20:36:47 -03:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
${uorb_sources}
|
|
|
|
${msg_source_out_path}/uORBTopics.cpp
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/msg/px_generate_uorb_topic_files.py
|
2017-09-25 19:00:59 -03:00
|
|
|
--sources
|
|
|
|
-f ${msg_files}
|
|
|
|
-i ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
-o ${msg_source_out_path}
|
2022-10-19 20:36:47 -03:00
|
|
|
-e ${PX4_SOURCE_DIR}/Tools/msg/templates/uorb
|
2018-03-27 13:19:04 -03:00
|
|
|
DEPENDS
|
|
|
|
${msg_files}
|
2022-10-19 20:36:47 -03:00
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/templates/uorb/msg.cpp.em
|
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/templates/uorb/uORBTopics.cpp.em
|
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/px_generate_uorb_topic_files.py
|
|
|
|
${PX4_SOURCE_DIR}/Tools/msg/px_generate_uorb_topic_helper.py
|
2017-09-25 19:00:59 -03:00
|
|
|
COMMENT "Generating uORB topic sources"
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
VERBATIM
|
|
|
|
)
|
2016-05-16 04:22:34 -03:00
|
|
|
|
2022-10-19 20:36:47 -03:00
|
|
|
add_library(uorb_msgs ${uorb_headers} ${msg_out_path}/uORBTopics.hpp ${uorb_sources} ${msg_source_out_path}/uORBTopics.cpp)
|
|
|
|
target_link_libraries(uorb_msgs PRIVATE m)
|
2018-04-11 16:10:51 -03:00
|
|
|
add_dependencies(uorb_msgs prebuild_targets uorb_headers)
|