From 56de0e27d8b9202169e787ecd891866ade621379 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sun, 19 Dec 2021 16:51:32 -0500 Subject: [PATCH] PX4 ROS2 msg conformity and explicit topics - .msg files are PascalCase - topics are still either per msg or explicitly listed in TOPICS - compatible structs are still generated (eg struct msg_s), but ROS2 style px4::msg::Msg is also available --- .vscode/cmake-variants.yaml | 5 + .vscode/settings.json | 7 +- CMakeLists.txt | 207 ++++++-- Kconfig | 3 + Makefile | 2 +- .../bitcraze/crazyflie/syslink/CMakeLists.txt | 2 + .../can-rtk-gps/canbootloader.px4board | 1 - boards/freefly/can-rtk-gps/src/CMakeLists.txt | 1 + boards/px4/ros2/default.px4board | 1 + boards/px4/ros2/src/CMakeLists.txt | 36 ++ .../px4/ros2/src/board_config.h | 29 +- .../px4/ros2/src/init.cpp | 0 cmake/package.cmake | 5 +- cmake/px4_add_common_flags.cmake | 20 +- cmake/px4_add_library.cmake | 5 +- cmake/px4_add_module.cmake | 23 +- cmake/px4_config.cmake | 12 +- launch/multi_uav_mavros_sitl.launch | 114 ----- launch/multi_uav_mavros_sitl_sdf.launch | 105 ---- launch/pub_test.launch | 13 - launch/px4.launch | 18 - launch/single_vehicle_spawn.launch | 36 -- launch/single_vehicle_spawn_sdf.launch | 32 -- msg/{action_request.msg => ActionRequest.msg} | 0 msg/{actuator_armed.msg => ActuatorArmed.msg} | 0 ...ator_controls.msg => ActuatorControls.msg} | 3 - ..._status.msg => ActuatorControlsStatus.msg} | 2 - ...actuator_motors.msg => ActuatorMotors.msg} | 0 ...tuator_outputs.msg => ActuatorOutputs.msg} | 0 ...actuator_servos.msg => ActuatorServos.msg} | 0 ...servos_trim.msg => ActuatorServosTrim.msg} | 0 msg/{actuator_test.msg => ActuatorTest.msg} | 0 msg/{adc_report.msg => AdcReport.msg} | 0 msg/{airspeed.msg => Airspeed.msg} | 0 ...ed_validated.msg => AirspeedValidated.msg} | 0 msg/{airspeed_wind.msg => AirspeedWind.msg} | 0 ....msg => AutotuneAttitudeControlStatus.msg} | 0 msg/{battery_status.msg => BatteryStatus.msg} | 0 msg/CMakeLists.txt | 421 +++++++--------- msg/{camera_capture.msg => CameraCapture.msg} | 0 msg/{camera_status.msg => CameraStatus.msg} | 0 msg/{camera_trigger.msg => CameraTrigger.msg} | 2 - ...cellular_status.msg => CellularStatus.msg} | 0 ...nstraints.msg => CollisionConstraints.msg} | 0 ...llision_report.msg => CollisionReport.msg} | 0 ...commander_state.msg => CommanderState.msg} | 0 ..._status.msg => ControlAllocatorStatus.msg} | 0 msg/{cpuload.msg => Cpuload.msg} | 0 msg/{debug_array.msg => DebugArray.msg} | 0 ...{debug_key_value.msg => DebugKeyValue.msg} | 0 msg/{debug_value.msg => DebugValue.msg} | 0 msg/{debug_vect.msg => DebugVect.msg} | 0 ..._pressure.msg => DifferentialPressure.msg} | 0 ...distance_sensor.msg => DistanceSensor.msg} | 0 ...ekf2_timestamps.msg => Ekf2Timestamps.msg} | 0 msg/{ekf_gps_drift.msg => EkfGpsDrift.msg} | 0 msg/{esc_report.msg => EscReport.msg} | 0 msg/{esc_status.msg => EscStatus.msg} | 2 +- ...or_baro_bias.msg => EstimatorBaroBias.msg} | 0 ...vent_flags.msg => EstimatorEventFlags.msg} | 0 ...novations.msg => EstimatorInnovations.msg} | 2 - ...ow_vel.msg => EstimatorOpticalFlowVel.msg} | 0 ...status.msg => EstimatorSelectorStatus.msg} | 0 ...ensor_bias.msg => EstimatorSensorBias.msg} | 0 ...timator_states.msg => EstimatorStates.msg} | 0 ...timator_status.msg => EstimatorStatus.msg} | 0 ...tus_flags.msg => EstimatorStatusFlags.msg} | 0 msg/{event.msg => Event.msg} | 0 ...r_status.msg => FailureDetectorStatus.msg} | 0 msg/{follow_target.msg => FollowTarget.msg} | 4 +- ...nerator_status.msg => GeneratorStatus.msg} | 0 ...geofence_result.msg => GeofenceResult.msg} | 0 ...tus.msg => GimbalDeviceAttitudeStatus.msg} | 0 ...mation.msg => GimbalDeviceInformation.msg} | 0 ...titude.msg => GimbalDeviceSetAttitude.msg} | 0 ...ation.msg => GimbalManagerInformation.msg} | 0 ...itude.msg => GimbalManagerSetAttitude.msg} | 0 ....msg => GimbalManagerSetManualControl.msg} | 0 ...ger_status.msg => GimbalManagerStatus.msg} | 0 msg/{gps_dump.msg => GpsDump.msg} | 0 ...{gps_inject_data.msg => GpsInjectData.msg} | 0 msg/{heater_status.msg => HeaterStatus.msg} | 0 msg/{home_position.msg => HomePosition.msg} | 0 ...t_estimate.msg => HoverThrustEstimate.msg} | 0 msg/{input_rc.msg => InputRc.msg} | 0 ...msg => InternalCombustionEngineStatus.msg} | 0 ...iumsbd_status.msg => IridiumsbdStatus.msg} | 0 msg/{irlock_report.msg => IrlockReport.msg} | 0 msg/{landing_gear.msg => LandingGear.msg} | 0 ...tions.msg => LandingTargetInnovations.msg} | 0 ..._target_pose.msg => LandingTargetPose.msg} | 0 msg/{led_control.msg => LedControl.msg} | 0 msg/{log_message.msg => LogMessage.msg} | 0 msg/{logger_status.msg => LoggerStatus.msg} | 0 ...{mag_worker_data.msg => MagWorkerData.msg} | 0 ...imate.msg => MagnetometerBiasEstimate.msg} | 0 ...setpoint.msg => ManualControlSetpoint.msg} | 2 - ...switches.msg => ManualControlSwitches.msg} | 0 msg/{mavlink_log.msg => MavlinkLog.msg} | 0 msg/{mission.msg => Mission.msg} | 0 msg/{mission_result.msg => MissionResult.msg} | 0 ...t_orientation.msg => MountOrientation.msg} | 0 ...sion_item.msg => NavigatorMissionItem.msg} | 0 msg/{npfg_status.msg => NpfgStatus.msg} | 0 ...acle_distance.msg => ObstacleDistance.msg} | 2 - ...ntrol_mode.msg => OffboardControlMode.msg} | 0 ...r_status.msg => OnboardComputerStatus.msg} | 0 msg/{optical_flow.msg => OpticalFlow.msg} | 0 msg/OrbTest.msg | 3 + msg/{orb_test_large.msg => OrbTestLarge.msg} | 0 msg/{orb_test.msg => OrbTestMedium.msg} | 2 +- msg/{orbit_status.msg => OrbitStatus.msg} | 0 ...rameter_update.msg => ParameterUpdate.msg} | 0 msg/{ping.msg => Ping.msg} | 0 ...sg => PositionControllerLandingStatus.msg} | 0 ...tatus.msg => PositionControllerStatus.msg} | 0 ...tion_setpoint.msg => PositionSetpoint.msg} | 0 ...riplet.msg => PositionSetpointTriplet.msg} | 6 +- ..._button_state.msg => PowerButtonState.msg} | 0 msg/{power_monitor.msg => PowerMonitor.msg} | 0 msg/{pps_capture.msg => PpsCapture.msg} | 0 msg/{pwm_input.msg => PwmInput.msg} | 0 msg/{px4io_status.msg => Px4ioStatus.msg} | 0 msg/{radio_status.msg => RadioStatus.msg} | 0 ...ate_ctrl_status.msg => RateCtrlStatus.msg} | 0 msg/{rc_channels.msg => RcChannels.msg} | 0 ...c_parameter_map.msg => RcParameterMap.msg} | 0 msg/{rpm.msg => Rpm.msg} | 0 ..._time_estimate.msg => RtlTimeEstimate.msg} | 0 msg/{safety.msg => Safety.msg} | 0 msg/{satellite_info.msg => SatelliteInfo.msg} | 0 msg/{sensor_accel.msg => SensorAccel.msg} | 0 ...sor_accel_fifo.msg => SensorAccelFifo.msg} | 0 msg/{sensor_baro.msg => SensorBaro.msg} | 0 ...sensor_combined.msg => SensorCombined.msg} | 0 ...or_correction.msg => SensorCorrection.msg} | 0 msg/{sensor_gps.msg => SensorGps.msg} | 0 msg/{sensor_gyro.msg => SensorGyro.msg} | 0 ...{sensor_gyro_fft.msg => SensorGyroFft.msg} | 0 ...ensor_gyro_fifo.msg => SensorGyroFifo.msg} | 0 ...or_hygrometer.msg => SensorHygrometer.msg} | 0 msg/{sensor_mag.msg => SensorMag.msg} | 0 ...eflight_mag.msg => SensorPreflightMag.msg} | 0 ...nsor_selection.msg => SensorSelection.msg} | 0 ...rs_status_imu.msg => SensorsStatusImu.msg} | 0 msg/{system_power.msg => SystemPower.msg} | 0 msg/{takeoff_status.msg => TakeoffStatus.msg} | 0 ...{task_stack_info.msg => TaskStackInfo.msg} | 0 msg/{tecs_status.msg => TecsStatus.msg} | 0 ...lemetry_status.msg => TelemetryStatus.msg} | 0 msg/{test_motor.msg => TestMotor.msg} | 0 msg/{timesync.msg => Timesync.msg} | 0 ...timesync_status.msg => TimesyncStatus.msg} | 0 ...ectory_bezier.msg => TrajectoryBezier.msg} | 0 ...ry_waypoint.msg => TrajectoryWaypoint.msg} | 0 ...onder_report.msg => TransponderReport.msg} | 0 msg/{tune_control.msg => TuneControl.msg} | 0 ...request.msg => UavcanParameterRequest.msg} | 0 ...ter_value.msg => UavcanParameterValue.msg} | 0 msg/{ulog_stream.msg => UlogStream.msg} | 0 ...{ulog_stream_ack.msg => UlogStreamAck.msg} | 0 ...celeration.msg => VehicleAcceleration.msg} | 0 ...ehicle_air_data.msg => VehicleAirData.msg} | 0 ...ion.msg => VehicleAngularAcceleration.msg} | 0 ...=> VehicleAngularAccelerationSetpoint.msg} | 0 ...elocity.msg => VehicleAngularVelocity.msg} | 2 - ...hicle_attitude.msg => VehicleAttitude.msg} | 3 - ...tpoint.msg => VehicleAttitudeSetpoint.msg} | 2 - ...vehicle_command.msg => VehicleCommand.msg} | 0 ..._command_ack.msg => VehicleCommandAck.msg} | 0 ...constraints.msg => VehicleConstraints.msg} | 0 ...ontrol_mode.msg => VehicleControlMode.msg} | 0 ...position.msg => VehicleGlobalPosition.msg} | 3 - ...ps_position.msg => VehicleGpsPosition.msg} | 0 msg/{vehicle_imu.msg => VehicleImu.msg} | 0 ...le_imu_status.msg => VehicleImuStatus.msg} | 0 ...d_detected.msg => VehicleLandDetected.msg} | 0 ..._position.msg => VehicleLocalPosition.msg} | 3 - ...t.msg => VehicleLocalPositionSetpoint.msg} | 2 - ...gnetometer.msg => VehicleMagnetometer.msg} | 0 ...hicle_odometry.msg => VehicleOdometry.msg} | 3 - ..._setpoint.msg => VehicleRatesSetpoint.msg} | 0 msg/{vehicle_roi.msg => VehicleRoi.msg} | 0 msg/{vehicle_status.msg => VehicleStatus.msg} | 0 ...tatus_flags.msg => VehicleStatusFlags.msg} | 0 ...setpoint.msg => VehicleThrustSetpoint.msg} | 0 ...setpoint.msg => VehicleTorqueSetpoint.msg} | 0 ...bezier.msg => VehicleTrajectoryBezier.msg} | 4 +- ...oint.msg => VehicleTrajectoryWaypoint.msg} | 4 +- ...hicle_status.msg => VtolVehicleStatus.msg} | 0 msg/{wheel_encoders.msg => WheelEncoders.msg} | 0 msg/{wind.msg => Wind.msg} | 2 - ...ator_status.msg => YawEstimatorStatus.msg} | 0 msg/orb_test_medium.msg | 7 - msg/templates/uorb/msg.cpp.em | 92 ---- msg/templates/uorb/msg.h.em | 87 +++- msg/templates/uorb/uORBTopics.cpp.em | 42 +- msg/templates/uorb/uORBTopics.hpp.em | 35 +- msg/tools/px_generate_uorb_topic_files.py | 345 ++----------- msg/tools/px_generate_uorb_topic_helper.py | 2 + package.xml | 69 +-- platforms/common/CMakeLists.txt | 60 +-- .../include/px4_platform_common/Node.hpp | 47 ++ .../include/px4_platform_common/workqueue.h | 1 - platforms/common/uORB/Publication.hpp | 2 +- platforms/common/uORB/Subscription.hpp | 6 +- .../common/uORB/SubscriptionInterval.hpp | 3 + platforms/common/uORB/uORB.h | 10 +- platforms/common/uORB/uORBCommunicator.hpp | 9 - platforms/common/uORB/uORBDeviceMaster.hpp | 2 +- .../common/uORB/uORB_tests/CMakeLists.txt | 9 + platforms/common/work_queue/CMakeLists.txt | 4 +- platforms/common/work_queue/hrt_queue.c | 26 +- platforms/common/work_queue/hrt_thread.c | 4 +- platforms/common/work_queue/work_lock.c | 1 + platforms/nuttx/CMakeLists.txt | 2 + platforms/nuttx/cmake/px4_impl_os.cmake | 15 +- .../nuttx/src/canbootloader/CMakeLists.txt | 4 +- .../arch/nxp/s32k14x/CMakeLists.txt | 5 +- .../arch/nxp/s32k14x/drivers/can/driver.c | 2 +- .../arch/stm/stm32f4/CMakeLists.txt | 4 +- .../arch/stm/stm32f4/drivers/can/driver.c | 2 +- .../arch/stm/stm32f7/CMakeLists.txt | 4 +- .../arch/stm/stm32f7/drivers/can/driver.c | 2 +- .../nuttx/src/canbootloader/protocol/uavcan.c | 2 +- .../nuttx/src/canbootloader/uavcan/main.c | 2 +- platforms/nuttx/src/px4/common/CMakeLists.txt | 29 +- .../src/px4/nxp/imxrt/hrt/CMakeLists.txt | 5 +- .../src/px4/nxp/kinetis/hrt/CMakeLists.txt | 6 +- .../src/px4/nxp/s32k1xx/hrt/CMakeLists.txt | 5 +- .../src/px4/rpi/rpi_common/hrt/CMakeLists.txt | 9 +- .../px4/stm/stm32_common/hrt/CMakeLists.txt | 9 +- .../px4/stm/stm32f1/watchdog/CMakeLists.txt | 3 +- .../px4/stm/stm32f4/watchdog/CMakeLists.txt | 3 +- .../px4/stm/stm32f7/watchdog/CMakeLists.txt | 3 +- platforms/posix/include/px4_platform_types.h | 3 - platforms/ros2/CMakeLists.txt | 34 ++ platforms/ros2/cmake/Toolchain-native.cmake | 17 + platforms/ros2/cmake/finalize.cmake | 3 + platforms/ros2/cmake/init.cmake | 181 +++++++ platforms/ros2/cmake/px4_impl_os.cmake | 148 ++++++ .../ros2/include/hrt_work.h | 47 +- .../ros2/include/px4_platform_common/Node.hpp | 42 ++ .../include/px4_platform_common/defines.h | 53 ++ .../ros2/include/px4_platform_common/log.h | 41 ++ .../ros2/include/px4_platform_common/module.h | 417 ++++++++++++++++ .../px4_platform_common/module_params.h | 96 ++++ .../ros2/include/px4_platform_common/param.h | 452 ++++++++++++++++++ .../px4_platform_common/param_macros.h | 250 ++++++++++ .../ros2/include/px4_platform_common/posix.h | 40 ++ .../include/px4_platform_common/px4_config.h | 40 ++ .../ros2/include/px4_platform_common/sem.h | 108 +++++ .../ros2/include/px4_platform_common/tasks.h | 187 ++++++++ .../ros2/include/px4_platform_common/time.h | 6 + .../include/px4_platform_common/workqueue.h | 140 ++++++ platforms/ros2/include/queue.h | 134 ++++++ .../ros2/include/system_config.h | 83 +--- platforms/ros2/include/uORB/Publication.hpp | 148 ++++++ platforms/ros2/include/uORB/Subscription.hpp | 167 +++++++ .../ros2/include/uORB/SubscriptionBasic.hpp | 155 ++++++ platforms/ros2/include/uORB/uORB.h | 99 ++++ platforms/ros2/src/px4/CMakeLists.txt | 37 ++ platforms/ros2/src/px4/common/CMakeLists.txt | 39 ++ platforms/ros2/src/px4/common/drv_hrt.cpp | 245 ++++++++++ .../common/include/px4_platform/micro_hal.h | 51 ++ platforms/ros2/src/px4/common/main.cpp | 19 + platforms/ros2/src/px4/common/px4_sem.cpp | 219 +++++++++ platforms/ros2/src/px4/generic/CMakeLists.txt | 34 ++ .../src/px4/generic/generic/CMakeLists.txt | 32 ++ .../generic/include/px4_arch/CMakeLists.txt | 0 .../include/px4_arch/i2c_hw_description.h | 53 ++ .../generic/include/px4_arch/micro_hal.h | 36 ++ .../include/px4_arch/spi_hw_description.h | 59 +++ src/drivers/adc/ads1115/CMakeLists.txt | 6 +- src/drivers/adc/board_adc/CMakeLists.txt | 3 + src/drivers/barometer/bmp388/CMakeLists.txt | 2 + src/drivers/barometer/ms5611/CMakeLists.txt | 2 + src/drivers/bootloaders/CMakeLists.txt | 4 +- src/drivers/bootloaders/boot_alt_app_shared.c | 2 +- src/drivers/bootloaders/boot_app_shared.c | 2 +- src/drivers/camera_capture/CMakeLists.txt | 5 +- src/drivers/camera_trigger/CMakeLists.txt | 3 + .../differential_pressure/ets/CMakeLists.txt | 2 + .../ms4525/CMakeLists.txt | 2 + .../ms5525/CMakeLists.txt | 2 + .../sdp3x/CMakeLists.txt | 2 + .../broadcom/afbrs50/CMakeLists.txt | 2 + .../distance_sensor/cm8jl65/CMakeLists.txt | 2 + .../distance_sensor/gy_us42/CMakeLists.txt | 2 + .../distance_sensor/leddar_one/CMakeLists.txt | 2 + .../distance_sensor/mappydot/CMakeLists.txt | 2 + src/drivers/dshot/CMakeLists.txt | 7 + src/drivers/gps/CMakeLists.txt | 4 + src/drivers/heater/CMakeLists.txt | 2 + src/drivers/imu/bosch/bmi088/CMakeLists.txt | 5 + .../imu/invensense/icm20602/CMakeLists.txt | 5 + .../imu/invensense/icm42688p/CMakeLists.txt | 5 + .../imu/invensense/mpu6000/CMakeLists.txt | 5 + src/drivers/irlock/CMakeLists.txt | 2 + .../magnetometer/akm/ak09916/CMakeLists.txt | 2 + .../magnetometer/akm/ak8963/CMakeLists.txt | 2 + .../magnetometer/bosch/bmm150/CMakeLists.txt | 2 + .../magnetometer/hmc5883/CMakeLists.txt | 2 + .../isentek/ist8308/CMakeLists.txt | 2 + .../isentek/ist8310/CMakeLists.txt | 2 + .../magnetometer/lis3mdl/CMakeLists.txt | 2 + .../magnetometer/lsm303agr/CMakeLists.txt | 2 + .../magnetometer/lsm9ds1_mag/CMakeLists.txt | 2 + .../magnetometer/qmc5883l/CMakeLists.txt | 2 + .../magnetometer/rm3100/CMakeLists.txt | 2 + .../vtrantech/vcm1193l/CMakeLists.txt | 2 + .../optical_flow/paw3902/CMakeLists.txt | 2 + .../optical_flow/pmw3901/CMakeLists.txt | 2 + .../optical_flow/px4flow/CMakeLists.txt | 2 + .../optical_flow/thoneflow/CMakeLists.txt | 2 + .../power_monitor/ina228/CMakeLists.txt | 2 + .../power_monitor/voxlpm/CMakeLists.txt | 3 + src/drivers/pps_capture/CMakeLists.txt | 2 + src/drivers/pwm_input/CMakeLists.txt | 2 + src/drivers/pwm_out/CMakeLists.txt | 8 +- src/drivers/pwm_out_sim/CMakeLists.txt | 8 +- src/drivers/px4io/CMakeLists.txt | 8 + src/drivers/rc_input/CMakeLists.txt | 2 + src/drivers/roboclaw/CMakeLists.txt | 2 + src/drivers/rpm/pcf8583/CMakeLists.txt | 2 + src/drivers/rpm/rpm_simulator/CMakeLists.txt | 2 + src/drivers/safety_button/CMakeLists.txt | 5 + src/drivers/tap_esc/CMakeLists.txt | 7 + .../telemetry/frsky_telemetry/CMakeLists.txt | 2 + .../telemetry/iridiumsbd/CMakeLists.txt | 2 + src/drivers/test_ppm/test_ppm.cpp | 1 - src/drivers/tone_alarm/CMakeLists.txt | 2 + src/drivers/uavcan/CMakeLists.txt | 6 + src/drivers/uavcannode/CMakeLists.txt | 19 + src/examples/fake_imu/CMakeLists.txt | 6 + src/examples/fixedwing_control/main.cpp | 6 +- src/examples/px4_simple_app/CMakeLists.txt | 2 +- .../{px4_simple_app.c => px4_simple_app.cpp} | 4 +- src/examples/rover_steering_control/main.cpp | 6 +- src/lib/CMakeLists.txt | 81 ++-- src/lib/crc/CMakeLists.txt | 39 ++ src/lib/{systemlib => crc}/crc.c | 0 src/lib/{systemlib => crc}/crc.h | 0 src/lib/parameters/CMakeLists.txt | 12 +- src/lib/parameters/tinybson/CMakeLists.txt | 2 +- src/lib/systemlib/CMakeLists.txt | 8 +- src/lib/systemlib/otp.c | 3 +- .../airship_att_control/CMakeLists.txt | 3 + .../airship_att_control_main.cpp | 2 +- src/modules/airspeed_selector/CMakeLists.txt | 3 + .../airspeed_selector_main.cpp | 15 +- .../CMakeLists.txt | 5 + .../attitude_estimator_q/CMakeLists.txt | 2 + src/modules/battery_status/CMakeLists.txt | 2 + src/modules/camera_feedback/CMakeLists.txt | 2 + src/modules/commander/CMakeLists.txt | 39 +- src/modules/commander/Commander.hpp | 4 +- src/modules/control_allocator/CMakeLists.txt | 12 + src/modules/ekf2/CMakeLists.txt | 31 ++ .../flight_mode_manager/CMakeLists.txt | 14 + src/modules/fw_att_control/CMakeLists.txt | 11 + .../CMakeLists.txt | 2 + src/modules/fw_pos_control_l1/CMakeLists.txt | 8 + src/modules/gyro_fft/CMakeLists.txt | 2 + src/modules/land_detector/CMakeLists.txt | 7 + .../landing_target_estimator/CMakeLists.txt | 3 + src/modules/load_mon/CMakeLists.txt | 3 + src/modules/logger/CMakeLists.txt | 3 + src/modules/logger/logged_topics.cpp | 2 +- src/modules/logger/logged_topics.h | 2 +- src/modules/logger/logger.cpp | 2 +- src/modules/mag_bias_estimator/CMakeLists.txt | 2 + src/modules/manual_control/CMakeLists.txt | 5 + src/modules/mavlink/CMakeLists.txt | 68 +++ src/modules/mc_att_control/CMakeLists.txt | 6 +- .../CMakeLists.txt | 2 + .../mc_hover_thrust_estimator/CMakeLists.txt | 2 + src/modules/mc_pos_control/CMakeLists.txt | 7 +- src/modules/mc_rate_control/CMakeLists.txt | 8 + src/modules/navigator/CMakeLists.txt | 12 + src/modules/rc_update/CMakeLists.txt | 5 + src/modules/replay/Replay.hpp | 2 +- src/modules/rover_pos_control/CMakeLists.txt | 6 + src/modules/sensors/CMakeLists.txt | 72 +++ src/modules/sih/CMakeLists.txt | 5 + src/modules/simulator/CMakeLists.txt | 20 + .../battery_simulator/CMakeLists.txt | 2 + .../temperature_compensation/CMakeLists.txt | 3 + src/modules/uuv_att_control/CMakeLists.txt | 3 + src/modules/vmount/CMakeLists.txt | 6 + src/modules/vtol_att_control/CMakeLists.txt | 7 + .../topic_listener/generate_listener.py | 140 ++++++ .../topic_listener/listener_main.cpp | 2 +- uORBTopics.cpp.in | 56 +++ .../px4/ros/msg.h.em => uORBTopics.hpp.in | 80 ++-- 395 files changed, 5601 insertions(+), 1517 deletions(-) create mode 100644 boards/px4/ros2/default.px4board create mode 100644 boards/px4/ros2/src/CMakeLists.txt rename src/lib/systemlib/conversions.c => boards/px4/ros2/src/board_config.h (79%) rename msg/tools/__init__.py => boards/px4/ros2/src/init.cpp (100%) delete mode 100644 launch/multi_uav_mavros_sitl.launch delete mode 100644 launch/multi_uav_mavros_sitl_sdf.launch delete mode 100644 launch/pub_test.launch delete mode 100644 launch/px4.launch delete mode 100644 launch/single_vehicle_spawn.launch delete mode 100644 launch/single_vehicle_spawn_sdf.launch rename msg/{action_request.msg => ActionRequest.msg} (100%) rename msg/{actuator_armed.msg => ActuatorArmed.msg} (100%) rename msg/{actuator_controls.msg => ActuatorControls.msg} (79%) rename msg/{actuator_controls_status.msg => ActuatorControlsStatus.msg} (66%) rename msg/{actuator_motors.msg => ActuatorMotors.msg} (100%) rename msg/{actuator_outputs.msg => ActuatorOutputs.msg} (100%) rename msg/{actuator_servos.msg => ActuatorServos.msg} (100%) rename msg/{actuator_servos_trim.msg => ActuatorServosTrim.msg} (100%) rename msg/{actuator_test.msg => ActuatorTest.msg} (100%) rename msg/{adc_report.msg => AdcReport.msg} (100%) rename msg/{airspeed.msg => Airspeed.msg} (100%) rename msg/{airspeed_validated.msg => AirspeedValidated.msg} (100%) rename msg/{airspeed_wind.msg => AirspeedWind.msg} (100%) rename msg/{autotune_attitude_control_status.msg => AutotuneAttitudeControlStatus.msg} (100%) rename msg/{battery_status.msg => BatteryStatus.msg} (100%) rename msg/{camera_capture.msg => CameraCapture.msg} (100%) rename msg/{camera_status.msg => CameraStatus.msg} (100%) rename msg/{camera_trigger.msg => CameraTrigger.msg} (89%) rename msg/{cellular_status.msg => CellularStatus.msg} (100%) rename msg/{collision_constraints.msg => CollisionConstraints.msg} (100%) rename msg/{collision_report.msg => CollisionReport.msg} (100%) rename msg/{commander_state.msg => CommanderState.msg} (100%) rename msg/{control_allocator_status.msg => ControlAllocatorStatus.msg} (100%) rename msg/{cpuload.msg => Cpuload.msg} (100%) rename msg/{debug_array.msg => DebugArray.msg} (100%) rename msg/{debug_key_value.msg => DebugKeyValue.msg} (100%) rename msg/{debug_value.msg => DebugValue.msg} (100%) rename msg/{debug_vect.msg => DebugVect.msg} (100%) rename msg/{differential_pressure.msg => DifferentialPressure.msg} (100%) rename msg/{distance_sensor.msg => DistanceSensor.msg} (100%) rename msg/{ekf2_timestamps.msg => Ekf2Timestamps.msg} (100%) rename msg/{ekf_gps_drift.msg => EkfGpsDrift.msg} (100%) rename msg/{esc_report.msg => EscReport.msg} (100%) rename msg/{esc_status.msg => EscStatus.msg} (98%) rename msg/{estimator_baro_bias.msg => EstimatorBaroBias.msg} (100%) rename msg/{estimator_event_flags.msg => EstimatorEventFlags.msg} (100%) rename msg/{estimator_innovations.msg => EstimatorInnovations.msg} (95%) rename msg/{estimator_optical_flow_vel.msg => EstimatorOpticalFlowVel.msg} (100%) rename msg/{estimator_selector_status.msg => EstimatorSelectorStatus.msg} (100%) rename msg/{estimator_sensor_bias.msg => EstimatorSensorBias.msg} (100%) rename msg/{estimator_states.msg => EstimatorStates.msg} (100%) rename msg/{estimator_status.msg => EstimatorStatus.msg} (100%) rename msg/{estimator_status_flags.msg => EstimatorStatusFlags.msg} (100%) rename msg/{event.msg => Event.msg} (100%) rename msg/{failure_detector_status.msg => FailureDetectorStatus.msg} (100%) rename msg/{follow_target.msg => FollowTarget.msg} (75%) rename msg/{generator_status.msg => GeneratorStatus.msg} (100%) rename msg/{geofence_result.msg => GeofenceResult.msg} (100%) rename msg/{gimbal_device_attitude_status.msg => GimbalDeviceAttitudeStatus.msg} (100%) rename msg/{gimbal_device_information.msg => GimbalDeviceInformation.msg} (100%) rename msg/{gimbal_device_set_attitude.msg => GimbalDeviceSetAttitude.msg} (100%) rename msg/{gimbal_manager_information.msg => GimbalManagerInformation.msg} (100%) rename msg/{gimbal_manager_set_attitude.msg => GimbalManagerSetAttitude.msg} (100%) rename msg/{gimbal_manager_set_manual_control.msg => GimbalManagerSetManualControl.msg} (100%) rename msg/{gimbal_manager_status.msg => GimbalManagerStatus.msg} (100%) rename msg/{gps_dump.msg => GpsDump.msg} (100%) rename msg/{gps_inject_data.msg => GpsInjectData.msg} (100%) rename msg/{heater_status.msg => HeaterStatus.msg} (100%) rename msg/{home_position.msg => HomePosition.msg} (100%) rename msg/{hover_thrust_estimate.msg => HoverThrustEstimate.msg} (100%) rename msg/{input_rc.msg => InputRc.msg} (100%) rename msg/{internal_combustion_engine_status.msg => InternalCombustionEngineStatus.msg} (100%) rename msg/{iridiumsbd_status.msg => IridiumsbdStatus.msg} (100%) rename msg/{irlock_report.msg => IrlockReport.msg} (100%) rename msg/{landing_gear.msg => LandingGear.msg} (100%) rename msg/{landing_target_innovations.msg => LandingTargetInnovations.msg} (100%) rename msg/{landing_target_pose.msg => LandingTargetPose.msg} (100%) rename msg/{led_control.msg => LedControl.msg} (100%) rename msg/{log_message.msg => LogMessage.msg} (100%) rename msg/{logger_status.msg => LoggerStatus.msg} (100%) rename msg/{mag_worker_data.msg => MagWorkerData.msg} (100%) rename msg/{magnetometer_bias_estimate.msg => MagnetometerBiasEstimate.msg} (100%) rename msg/{manual_control_setpoint.msg => ManualControlSetpoint.msg} (97%) rename msg/{manual_control_switches.msg => ManualControlSwitches.msg} (100%) rename msg/{mavlink_log.msg => MavlinkLog.msg} (100%) rename msg/{mission.msg => Mission.msg} (100%) rename msg/{mission_result.msg => MissionResult.msg} (100%) rename msg/{mount_orientation.msg => MountOrientation.msg} (100%) rename msg/{navigator_mission_item.msg => NavigatorMissionItem.msg} (100%) rename msg/{npfg_status.msg => NpfgStatus.msg} (100%) rename msg/{obstacle_distance.msg => ObstacleDistance.msg} (96%) rename msg/{offboard_control_mode.msg => OffboardControlMode.msg} (100%) rename msg/{onboard_computer_status.msg => OnboardComputerStatus.msg} (100%) rename msg/{optical_flow.msg => OpticalFlow.msg} (100%) create mode 100644 msg/OrbTest.msg rename msg/{orb_test_large.msg => OrbTestLarge.msg} (100%) rename msg/{orb_test.msg => OrbTestMedium.msg} (68%) rename msg/{orbit_status.msg => OrbitStatus.msg} (100%) rename msg/{parameter_update.msg => ParameterUpdate.msg} (100%) rename msg/{ping.msg => Ping.msg} (100%) rename msg/{position_controller_landing_status.msg => PositionControllerLandingStatus.msg} (100%) rename msg/{position_controller_status.msg => PositionControllerStatus.msg} (100%) rename msg/{position_setpoint.msg => PositionSetpoint.msg} (100%) rename msg/{position_setpoint_triplet.msg => PositionSetpointTriplet.msg} (67%) rename msg/{power_button_state.msg => PowerButtonState.msg} (100%) rename msg/{power_monitor.msg => PowerMonitor.msg} (100%) rename msg/{pps_capture.msg => PpsCapture.msg} (100%) rename msg/{pwm_input.msg => PwmInput.msg} (100%) rename msg/{px4io_status.msg => Px4ioStatus.msg} (100%) rename msg/{radio_status.msg => RadioStatus.msg} (100%) rename msg/{rate_ctrl_status.msg => RateCtrlStatus.msg} (100%) rename msg/{rc_channels.msg => RcChannels.msg} (100%) rename msg/{rc_parameter_map.msg => RcParameterMap.msg} (100%) rename msg/{rpm.msg => Rpm.msg} (100%) rename msg/{rtl_time_estimate.msg => RtlTimeEstimate.msg} (100%) rename msg/{safety.msg => Safety.msg} (100%) rename msg/{satellite_info.msg => SatelliteInfo.msg} (100%) rename msg/{sensor_accel.msg => SensorAccel.msg} (100%) rename msg/{sensor_accel_fifo.msg => SensorAccelFifo.msg} (100%) rename msg/{sensor_baro.msg => SensorBaro.msg} (100%) rename msg/{sensor_combined.msg => SensorCombined.msg} (100%) rename msg/{sensor_correction.msg => SensorCorrection.msg} (100%) rename msg/{sensor_gps.msg => SensorGps.msg} (100%) rename msg/{sensor_gyro.msg => SensorGyro.msg} (100%) rename msg/{sensor_gyro_fft.msg => SensorGyroFft.msg} (100%) rename msg/{sensor_gyro_fifo.msg => SensorGyroFifo.msg} (100%) rename msg/{sensor_hygrometer.msg => SensorHygrometer.msg} (100%) mode change 100755 => 100644 rename msg/{sensor_mag.msg => SensorMag.msg} (100%) rename msg/{sensor_preflight_mag.msg => SensorPreflightMag.msg} (100%) rename msg/{sensor_selection.msg => SensorSelection.msg} (100%) rename msg/{sensors_status_imu.msg => SensorsStatusImu.msg} (100%) rename msg/{system_power.msg => SystemPower.msg} (100%) rename msg/{takeoff_status.msg => TakeoffStatus.msg} (100%) rename msg/{task_stack_info.msg => TaskStackInfo.msg} (100%) rename msg/{tecs_status.msg => TecsStatus.msg} (100%) rename msg/{telemetry_status.msg => TelemetryStatus.msg} (100%) rename msg/{test_motor.msg => TestMotor.msg} (100%) rename msg/{timesync.msg => Timesync.msg} (100%) rename msg/{timesync_status.msg => TimesyncStatus.msg} (100%) rename msg/{trajectory_bezier.msg => TrajectoryBezier.msg} (100%) rename msg/{trajectory_waypoint.msg => TrajectoryWaypoint.msg} (100%) rename msg/{transponder_report.msg => TransponderReport.msg} (100%) rename msg/{tune_control.msg => TuneControl.msg} (100%) rename msg/{uavcan_parameter_request.msg => UavcanParameterRequest.msg} (100%) rename msg/{uavcan_parameter_value.msg => UavcanParameterValue.msg} (100%) rename msg/{ulog_stream.msg => UlogStream.msg} (100%) rename msg/{ulog_stream_ack.msg => UlogStreamAck.msg} (100%) rename msg/{vehicle_acceleration.msg => VehicleAcceleration.msg} (100%) rename msg/{vehicle_air_data.msg => VehicleAirData.msg} (100%) rename msg/{vehicle_angular_acceleration.msg => VehicleAngularAcceleration.msg} (100%) rename msg/{vehicle_angular_acceleration_setpoint.msg => VehicleAngularAccelerationSetpoint.msg} (100%) rename msg/{vehicle_angular_velocity.msg => VehicleAngularVelocity.msg} (78%) rename msg/{vehicle_attitude.msg => VehicleAttitude.msg} (80%) rename msg/{vehicle_attitude_setpoint.msg => VehicleAttitudeSetpoint.msg} (92%) rename msg/{vehicle_command.msg => VehicleCommand.msg} (100%) rename msg/{vehicle_command_ack.msg => VehicleCommandAck.msg} (100%) rename msg/{vehicle_constraints.msg => VehicleConstraints.msg} (100%) rename msg/{vehicle_control_mode.msg => VehicleControlMode.msg} (100%) rename msg/{vehicle_global_position.msg => VehicleGlobalPosition.msg} (92%) rename msg/{vehicle_gps_position.msg => VehicleGpsPosition.msg} (100%) rename msg/{vehicle_imu.msg => VehicleImu.msg} (100%) rename msg/{vehicle_imu_status.msg => VehicleImuStatus.msg} (100%) rename msg/{vehicle_land_detected.msg => VehicleLandDetected.msg} (100%) rename msg/{vehicle_local_position.msg => VehicleLocalPosition.msg} (97%) rename msg/{vehicle_local_position_setpoint.msg => VehicleLocalPositionSetpoint.msg} (89%) rename msg/{vehicle_magnetometer.msg => VehicleMagnetometer.msg} (100%) rename msg/{vehicle_odometry.msg => VehicleOdometry.msg} (95%) rename msg/{vehicle_rates_setpoint.msg => VehicleRatesSetpoint.msg} (100%) rename msg/{vehicle_roi.msg => VehicleRoi.msg} (100%) rename msg/{vehicle_status.msg => VehicleStatus.msg} (100%) rename msg/{vehicle_status_flags.msg => VehicleStatusFlags.msg} (100%) rename msg/{vehicle_thrust_setpoint.msg => VehicleThrustSetpoint.msg} (100%) rename msg/{vehicle_torque_setpoint.msg => VehicleTorqueSetpoint.msg} (100%) rename msg/{vehicle_trajectory_bezier.msg => VehicleTrajectoryBezier.msg} (86%) rename msg/{vehicle_trajectory_waypoint.msg => VehicleTrajectoryWaypoint.msg} (86%) rename msg/{vtol_vehicle_status.msg => VtolVehicleStatus.msg} (100%) rename msg/{wheel_encoders.msg => WheelEncoders.msg} (100%) rename msg/{wind.msg => Wind.msg} (96%) rename msg/{yaw_estimator_status.msg => YawEstimatorStatus.msg} (100%) delete mode 100644 msg/orb_test_medium.msg delete mode 100644 msg/templates/uorb/msg.cpp.em create mode 100644 platforms/common/include/px4_platform_common/Node.hpp delete mode 100644 platforms/posix/include/px4_platform_types.h create mode 100644 platforms/ros2/CMakeLists.txt create mode 100644 platforms/ros2/cmake/Toolchain-native.cmake create mode 100644 platforms/ros2/cmake/finalize.cmake create mode 100644 platforms/ros2/cmake/init.cmake create mode 100644 platforms/ros2/cmake/px4_impl_os.cmake rename src/lib/systemlib/conversions.h => platforms/ros2/include/hrt_work.h (68%) create mode 100644 platforms/ros2/include/px4_platform_common/Node.hpp create mode 100644 platforms/ros2/include/px4_platform_common/defines.h create mode 100644 platforms/ros2/include/px4_platform_common/log.h create mode 100644 platforms/ros2/include/px4_platform_common/module.h create mode 100644 platforms/ros2/include/px4_platform_common/module_params.h create mode 100644 platforms/ros2/include/px4_platform_common/param.h create mode 100644 platforms/ros2/include/px4_platform_common/param_macros.h create mode 100644 platforms/ros2/include/px4_platform_common/posix.h create mode 100644 platforms/ros2/include/px4_platform_common/px4_config.h create mode 100644 platforms/ros2/include/px4_platform_common/sem.h create mode 100644 platforms/ros2/include/px4_platform_common/tasks.h create mode 100644 platforms/ros2/include/px4_platform_common/time.h create mode 100644 platforms/ros2/include/px4_platform_common/workqueue.h create mode 100644 platforms/ros2/include/queue.h rename msg/templates/px4/uorb/msg.h.em => platforms/ros2/include/system_config.h (55%) create mode 100644 platforms/ros2/include/uORB/Publication.hpp create mode 100644 platforms/ros2/include/uORB/Subscription.hpp create mode 100644 platforms/ros2/include/uORB/SubscriptionBasic.hpp create mode 100644 platforms/ros2/include/uORB/uORB.h create mode 100644 platforms/ros2/src/px4/CMakeLists.txt create mode 100644 platforms/ros2/src/px4/common/CMakeLists.txt create mode 100644 platforms/ros2/src/px4/common/drv_hrt.cpp create mode 100644 platforms/ros2/src/px4/common/include/px4_platform/micro_hal.h create mode 100644 platforms/ros2/src/px4/common/main.cpp create mode 100644 platforms/ros2/src/px4/common/px4_sem.cpp create mode 100644 platforms/ros2/src/px4/generic/CMakeLists.txt create mode 100644 platforms/ros2/src/px4/generic/generic/CMakeLists.txt create mode 100644 platforms/ros2/src/px4/generic/generic/include/px4_arch/CMakeLists.txt create mode 100644 platforms/ros2/src/px4/generic/generic/include/px4_arch/i2c_hw_description.h create mode 100644 platforms/ros2/src/px4/generic/generic/include/px4_arch/micro_hal.h create mode 100644 platforms/ros2/src/px4/generic/generic/include/px4_arch/spi_hw_description.h rename src/examples/px4_simple_app/{px4_simple_app.c => px4_simple_app.cpp} (97%) create mode 100644 src/lib/crc/CMakeLists.txt rename src/lib/{systemlib => crc}/crc.c (100%) rename src/lib/{systemlib => crc}/crc.h (100%) create mode 100755 src/systemcmds/topic_listener/generate_listener.py create mode 100644 uORBTopics.cpp.in rename msg/templates/px4/ros/msg.h.em => uORBTopics.hpp.in (57%) diff --git a/.vscode/cmake-variants.yaml b/.vscode/cmake-variants.yaml index a26b6f4e4e..ace3c7b98a 100644 --- a/.vscode/cmake-variants.yaml +++ b/.vscode/cmake-variants.yaml @@ -31,6 +31,11 @@ CONFIG: buildType: RelWithDebInfo settings: CONFIG: px4_sitl_test + px4_ros2_default: + short: px4_ros2 + buildType: RelWithDebInfo + settings: + CONFIG: px4_ros2_default px4_io-v2_default: short: px4_io-v2 buildType: MinSizeRel diff --git a/.vscode/settings.json b/.vscode/settings.json index 1bf4e6eb2f..c917fe0a03 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,7 @@ "C_Cpp.autoAddFileAssociations": false, "C_Cpp.clang_format_fallbackStyle": "none", "C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true, - "C_Cpp.default.cppStandard": "c++14", + "C_Cpp.default.cppStandard": "c++17", "C_Cpp.default.cStandard": "c11", "C_Cpp.formatting": "Disabled", "C_Cpp.intelliSenseEngine": "Default", @@ -121,6 +121,7 @@ "variant": "cpp", "vector": "cpp" }, + "ros.distro": "foxy", "search.exclude": { "${workspaceFolder}/build": true }, @@ -136,5 +137,7 @@ "yaml.schemas": { "${workspaceFolder}/validation/module_schema.yaml": "${workspaceFolder}/src/modules/*/module.yaml" }, - "cortex-debug.openocdPath": "${env:PICO_SDK_PATH}/../openocd/src/openocd" // Added for rp2040 + "python.autoComplete.extraPaths": [ + "/opt/ros/foxy/lib/python3.8/site-packages" + ] } diff --git a/CMakeLists.txt b/CMakeLists.txt index bca9b38eaa..d2f327f28e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,8 @@ cmake_minimum_required(VERSION 3.2 FATAL_ERROR) +cmake_policy(SET CMP0058 NEW) + set(PX4_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE FILEPATH "PX4 source directory" FORCE) set(PX4_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE FILEPATH "PX4 binary directory" FORCE) @@ -124,7 +126,6 @@ define_property(GLOBAL PROPERTY PX4_MODULE_LIBRARIES BRIEF_DOCS "PX4 module libs" FULL_DOCS "List of all PX4 module libraries" ) - define_property(GLOBAL PROPERTY PX4_MODULE_PATHS BRIEF_DOCS "PX4 module paths" FULL_DOCS "List of paths to all PX4 modules" @@ -133,29 +134,40 @@ define_property(GLOBAL PROPERTY PX4_SRC_FILES BRIEF_DOCS "src files from all PX4 modules & libs" FULL_DOCS "SRC files from px4_add_{module,library}" ) - +define_property(GLOBAL PROPERTY PX4_PUBLICATIONS + BRIEF_DOCS "PX4 publication topics" + FULL_DOCS "List of topics published by PX4 modules" + ) +define_property(GLOBAL PROPERTY PX4_SUBSCRIPTIONS + BRIEF_DOCS "PX4 subscription topics" + FULL_DOCS "List of topics subscribed by PX4 modules" + ) #============================================================================= # configuration # -set(CONFIG "px4_sitl_default" CACHE STRING "desired configuration") +# default to px4_ros2_default if building within a ROS2 colcon environment +if((DEFINED ENV{COLCON_PREFIX_PATH}) AND (DEFINED ENV{ROS_VERSION})) + if("$ENV{ROS_VERSION}" MATCHES "2") + message(STATUS "ROS_VERSION: $ENV{ROS_VERSION}") + set(CONFIG "px4_ros2_default" CACHE STRING "desired configuration") # TODO + endif() +endif() + +if(NOT CONFIG) + set(CONFIG "px4_sitl_default" CACHE STRING "desired configuration") +endif() include(px4_add_module) set(config_module_list) # Find Python -# If using catkin, Python 2 is found since it points -# to the Python libs installed with the ROS distro -if (NOT CATKIN_DEVEL_PREFIX) - find_package(PythonInterp 3) - # We have a custom error message to tell users how to install python3. - if (NOT PYTHONINTERP_FOUND) - message(FATAL_ERROR "Python 3 not found. Please install Python 3:\n" - " Ubuntu: sudo apt install python3 python3-dev python3-pip\n" - " macOS: brew install python") - endif() -else() - find_package(PythonInterp REQUIRED) +find_package(PythonInterp 3) +# We have a custom error message to tell users how to install python3. +if(NOT PYTHONINTERP_FOUND) + message(FATAL_ERROR "Python 3 not found. Please install Python 3:\n" + " Ubuntu: sudo apt install python3 python3-dev python3-pip\n" + " macOS: brew install python") endif() option(PYTHON_COVERAGE "Python code coverage" OFF) @@ -191,10 +203,6 @@ set_property(GLOBAL PROPERTY PX4_MODULE_CONFIG_FILES) include(platforms/${PX4_PLATFORM}/cmake/px4_impl_os.cmake) list(APPEND CMAKE_MODULE_PATH ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake) -if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake/init.cmake") - include(init) -endif() - # CMake build type (Debug Release RelWithDebInfo MinSizeRel Coverage) if(NOT CMAKE_BUILD_TYPE) if(${PX4_PLATFORM} STREQUAL "nuttx") @@ -230,7 +238,7 @@ project(px4 CXX C ASM) set(package-contact "px4users@googlegroups.com") -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) @@ -246,6 +254,10 @@ else() SET(BUILD_SHARED_LIBS OFF) endif() +if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake/init.cmake") + include(init) +endif() + #============================================================================= # gold linker - use if available (posix only for now) @@ -315,13 +327,6 @@ if(NOT PX4_CHIP) message(FATAL_ERROR "px4_os_determine_build_chip() needs to set PX4_CHIP") endif() -#============================================================================= -# build flags -# -include(px4_add_common_flags) -px4_add_common_flags() -px4_os_add_flags() - #============================================================================= # board cmake init (optional) # @@ -329,6 +334,13 @@ if(EXISTS ${PX4_BOARD_DIR}/cmake/init.cmake) include(${PX4_BOARD_DIR}/cmake/init.cmake) endif() +#============================================================================= +# build flags +# +include(px4_add_common_flags) +px4_add_common_flags() +px4_os_add_flags() + #============================================================================= # message, and airframe generation # @@ -410,8 +422,13 @@ add_library(parameters_interface INTERFACE) include(px4_add_library) add_subdirectory(src/lib EXCLUDE_FROM_ALL) -add_subdirectory(platforms/${PX4_PLATFORM}/src/px4) -add_subdirectory(platforms EXCLUDE_FROM_ALL) +add_subdirectory(platforms/${PX4_PLATFORM}/src/px4 EXCLUDE_FROM_ALL) + +if(${PX4_PLATFORM} MATCHES "ros2") # TODO: fix + add_subdirectory(platforms/common/work_queue EXCLUDE_FROM_ALL) +else() + add_subdirectory(platforms EXCLUDE_FROM_ALL) +endif() if(EXISTS "${PX4_BOARD_DIR}/CMakeLists.txt") add_subdirectory(${PX4_BOARD_DIR}) @@ -433,6 +450,126 @@ target_link_libraries(parameters_interface INTERFACE parameters) # firmware added last to generate the builtin for included modules add_subdirectory(platforms/${PX4_PLATFORM}) + +set(PX4_ORB_TOPIC_COUNT 0) + +if(${PX4_PLATFORM} MATCHES "ros2") # TODO: fix + + configure_file(${CMAKE_SOURCE_DIR}/build/px4_fmu-v5x_default/uORBTopics.cpp ${CMAKE_BINARY_DIR}/uORBTopics.cpp COPYONLY) + configure_file(${CMAKE_SOURCE_DIR}/build/px4_fmu-v5x_default/uORBTopics.hpp ${CMAKE_BINARY_DIR}/uORBTopics.hpp COPYONLY) + + set(PX4_ORB_TOPIC_COUNT 1) + +else() + + get_property(publications GLOBAL PROPERTY PX4_PUBLICATIONS) + get_property(subscriptions GLOBAL PROPERTY PX4_SUBSCRIPTIONS) + + # TODO: for now combine subsriptions and publications for complete topic list + list(APPEND publications ${subscriptions}) + + list(SORT publications) + list(REMOVE_DUPLICATES publications) + + set(pub_all_topics) + set(PX4_MSG_TYPE_ID) + set(PX4_MSG_TOPIC_ID) + set(PX4_MSG_TOPIC_ID_STRING) + set(PX4_MSG_TOPIC_ORB_ID) + + set(PX4_ORB_DECLARE_STR) + set(PX4_ORB_DEFINE_STR) + set(PX4_ORB_HEADER_INCLUDE_STR) + + + foreach(pub ${publications}) + #message(STATUS "pub: ${pub}") + string(REPLACE " /" ";" pub ${pub}) + + list(GET pub 0 pub_type) + list(GET pub 1 pub_topic) + + string(REPLACE "::" ";" pub_type_split ${pub_type}) + list(GET pub_type_split 2 pub_type_simple_lower) + + # Pascal case to snake case (PubType -> pub_type) + string(REGEX REPLACE "(.)([A-Z][a-z]+)" "\\1_\\2" pub_type_simple_lower "${pub_type_simple_lower}") + string(REGEX REPLACE "([a-z0-9])([A-Z])" "\\1_\\2" pub_type_simple_lower "${pub_type_simple_lower}") + string(TOLOWER "${pub_type_simple_lower}" pub_type_simple_lower) + + #message(STATUS "pub: Type: ${pub_type}, Topic: ${pub_topic} (${pub_type_simple_lower})") + + + + + # pub_type to include path (eg px4::msg::VehicleStatus => px4/msg/vehicle_status.hpp) + # temporary create px4/msg/vehicle_status.hpp which simply includes + + + + + list(APPEND pub_all_topics ${pub_topic}) + + list(APPEND PX4_MSG_TYPE_ID ${pub_type}) + + #list(APPEND PX4_MSG_TOPIC_ID ${pub_topic}) + set(PX4_MSG_TOPIC_ID "${PX4_MSG_TOPIC_ID}\t${pub_topic},\n") + #set(PX4_MSG_TOPIC_ID_STRING "${PX4_MSG_TOPIC_ID_STRING}\t"case ORB_ID::${pub_topic}: return \"${pub_topic}\";"\n") + set(PX4_MSG_TOPIC_ORB_ID "${PX4_MSG_TOPIC_ORB_ID}\tORB_ID(${pub_topic}),\n") + + list(APPEND PX4_MSG_TOPIC_ID_STRING + "case ORB_ID::${pub_topic}: return \"${pub_topic}\";\n" + ) + + # PX4_MSG_TYPE_ID + # PX4_MSG_TOPIC_ID + + # .h ORB_DECLARE(actuator_controls_0); + # .c ORB_DEFINE(actuator_controls_0, struct actuator_controls_s, 48, __orb_actuator_controls_fields, static_cast(ORB_ID::actuator_controls_0)); + + + set(PX4_ORB_DECLARE_STR + "${PX4_ORB_DECLARE_STR}ORB_DECLARE(${pub_topic});\n") + + # ORB_DEFINE(actuator_armed, struct actuator_armed_s, 16, __orb_actuator_armed_fields, static_cast(ORB_ID::actuator_armed)); + set(PX4_ORB_DEFINE_STR + "${PX4_ORB_DEFINE_STR}ORB_DEFINE(${pub_topic}, ${pub_type}, px4_embedded::${pub_type_simple_lower}_s::SIZE_NO_PADDING, px4_embedded::${pub_type_simple_lower}_s::FIELDS, static_cast(ORB_ID::${pub_topic}));\n") + + set(PX4_ORB_HEADER_INCLUDE_STR + "${PX4_ORB_HEADER_INCLUDE_STR}#include \n") + + math(EXPR PX4_ORB_TOPIC_COUNT "${PX4_ORB_TOPIC_COUNT}+1") + + endforeach() + list(REMOVE_DUPLICATES PX4_MSG_TYPE_ID) + #list(REMOVE_DUPLICATES PX4_MSG_TOPIC_ID) + + #message(STATUS "PX4_MSG_TYPE_ID: ${PX4_MSG_TYPE_ID}") + #message(STATUS "PX4_MSG_TOPIC_ID: ${PX4_MSG_TOPIC_ID}") + + if(PX4_ORB_TOPIC_COUNT GREATER 0) + configure_file(uORBTopics.cpp.in ${CMAKE_BINARY_DIR}/uORBTopics.cpp) + configure_file(uORBTopics.hpp.in ${CMAKE_BINARY_DIR}/uORBTopics.hpp) + endif() + + # .hpp enum ORB_ID + # .cpp struct orb_metadat ORB_ID() array + + foreach(f ${msg_files}) + #message(STATUS "MSG: ${f}") + endforeach() +endif() + +if(PX4_ORB_TOPIC_COUNT GREATER 0) + add_library(uorb_msgs ${uorb_headers} ${CMAKE_BINARY_DIR}/uORBTopics.cpp ${CMAKE_BINARY_DIR}/uORBTopics.hpp) + add_dependencies(uorb_msgs prebuild_targets uorb_headers) +endif() + +if(${PX4_PLATFORM} MATCHES "ros2") # TODO: fix + ament_target_dependencies(uorb_msgs rclcpp std_msgs) + rosidl_target_interfaces(uorb_msgs ${PROJECT_NAME} "rosidl_typesupport_cpp") +endif() + #============================================================================= # uORB graph generation: add a custom target 'uorb_graph' # @@ -460,17 +597,13 @@ include(doxygen) include(metadata) include(package) -# print size -add_custom_target(size - COMMAND size $ - DEPENDS px4 - WORKING_DIRECTORY ${PX4_BINARY_DIR} - USES_TERMINAL - ) - # install python requirements using configured python add_custom_target(install_python_requirements COMMAND ${PYTHON_EXECUTABLE} -m pip install --requirement ${PX4_SOURCE_DIR}/Tools/setup/requirements.txt DEPENDS ${PX4_SOURCE_DIR}/Tools/setup/requirements.txt USES_TERMINAL ) + +if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake/finalize.cmake") + include(finalize) +endif() diff --git a/Kconfig b/Kconfig index f44a72657c..b4286cca5d 100644 --- a/Kconfig +++ b/Kconfig @@ -17,6 +17,8 @@ menu "Toolchain" bool "posix" config PLATFORM_QURT bool "qurt" + config PLATFORM_ROS2 + bool "ros2" endchoice config BOARD_PLATFORM @@ -24,6 +26,7 @@ menu "Toolchain" default "nuttx" if PLATFORM_NUTTX default "posix" if PLATFORM_POSIX default "qurt" if PLATFORM_QURT + default "ros2" if PLATFORM_ROS2 config BOARD_LOCKSTEP bool "Force enable lockstep" diff --git a/Makefile b/Makefile index 7f43b46b68..97d155e612 100644 --- a/Makefile +++ b/Makefile @@ -479,7 +479,7 @@ clang-tidy-quiet: px4_sitl_default-clang # TODO: Fix cppcheck errors then try --enable=warning,performance,portability,style,unusedFunction or --enable=all cppcheck: px4_sitl_default @mkdir -p "$(SRC_DIR)"/build/cppcheck - @cppcheck -i"$(SRC_DIR)"/src/examples --enable=performance --std=c++14 --std=c99 --std=posix --project="$(SRC_DIR)"/build/px4_sitl_default/compile_commands.json --xml-version=2 2> "$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml > /dev/null + @cppcheck -i"$(SRC_DIR)"/src/examples --enable=performance --std=c++17 --std=c99 --std=posix --project="$(SRC_DIR)"/build/px4_sitl_default/compile_commands.json --xml-version=2 2> "$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml > /dev/null @cppcheck-htmlreport --source-encoding=ascii --file="$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml --report-dir="$(SRC_DIR)"/build/cppcheck --source-dir="$(SRC_DIR)"/src/ shellcheck_all: diff --git a/boards/bitcraze/crazyflie/syslink/CMakeLists.txt b/boards/bitcraze/crazyflie/syslink/CMakeLists.txt index ebf6c04c08..f89269dbc8 100644 --- a/boards/bitcraze/crazyflie/syslink/CMakeLists.txt +++ b/boards/bitcraze/crazyflie/syslink/CMakeLists.txt @@ -44,4 +44,6 @@ px4_add_module( syslink.c DEPENDS battery + SUBSCRIPTIONS + "px4::msg::BatteryStatus /battery_status" ) diff --git a/boards/freefly/can-rtk-gps/canbootloader.px4board b/boards/freefly/can-rtk-gps/canbootloader.px4board index b0fd876605..cc9f7769c1 100644 --- a/boards/freefly/can-rtk-gps/canbootloader.px4board +++ b/boards/freefly/can-rtk-gps/canbootloader.px4board @@ -3,4 +3,3 @@ CONFIG_BOARD_ARCHITECTURE="cortex-m7" CONFIG_BOARD_ROMFSROOT="" CONFIG_BOARD_CONSTRAINED_MEMORY=y CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y diff --git a/boards/freefly/can-rtk-gps/src/CMakeLists.txt b/boards/freefly/can-rtk-gps/src/CMakeLists.txt index bb4ba28a59..96eeddebf5 100644 --- a/boards/freefly/can-rtk-gps/src/CMakeLists.txt +++ b/boards/freefly/can-rtk-gps/src/CMakeLists.txt @@ -44,6 +44,7 @@ if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") nuttx_arch nuttx_drivers canbootloader + drivers__device ) target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) diff --git a/boards/px4/ros2/default.px4board b/boards/px4/ros2/default.px4board new file mode 100644 index 0000000000..a9c5b91a14 --- /dev/null +++ b/boards/px4/ros2/default.px4board @@ -0,0 +1 @@ +CONFIG_PLATFORM_ROS2=y diff --git a/boards/px4/ros2/src/CMakeLists.txt b/boards/px4/ros2/src/CMakeLists.txt new file mode 100644 index 0000000000..22e202d4e4 --- /dev/null +++ b/boards/px4/ros2/src/CMakeLists.txt @@ -0,0 +1,36 @@ +############################################################################ +# +# Copyright (c) 2021 PX4 Development Team. All rights reserved. +# +# 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. +# +############################################################################ + +add_library(drivers_board + init.cpp +) diff --git a/src/lib/systemlib/conversions.c b/boards/px4/ros2/src/board_config.h similarity index 79% rename from src/lib/systemlib/conversions.c rename to boards/px4/ros2/src/board_config.h index 94ff326e80..1f6b97375c 100644 --- a/src/lib/systemlib/conversions.c +++ b/boards/px4/ros2/src/board_config.h @@ -1,7 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. - * Author: @author Lorenz Meier + * Copyright (c) 2021 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,25 +32,19 @@ ****************************************************************************/ /** - * @file conversions.c - * Implementation of commonly used conversions. + * @file board_config.h + * + * SITL internal definitions */ -#include -#include +#pragma once -#include "conversions.h" +#define BOARD_OVERRIDE_UUID "SIMULATIONID0000" // must be of length 16 +#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_SITL -int16_t -int16_t_from_bytes(uint8_t bytes[]) -{ - union { - uint8_t b[2]; - int16_t w; - } u; +#define BOARD_HAS_POWER_CONTROL 1 - u.b[1] = bytes[0]; - u.b[0] = bytes[1]; +#define BOARD_NUMBER_BRICKS 0 - return u.w; -} +#include +#include diff --git a/msg/tools/__init__.py b/boards/px4/ros2/src/init.cpp similarity index 100% rename from msg/tools/__init__.py rename to boards/px4/ros2/src/init.cpp diff --git a/cmake/package.cmake b/cmake/package.cmake index fd71343221..69d3ab7a06 100644 --- a/cmake/package.cmake +++ b/cmake/package.cmake @@ -57,4 +57,7 @@ else() endif() include(CPack) -include(bloaty) + +if(${PX4_PLATFORM} MATCHES "nuttx") + include(bloaty) +endif() diff --git a/cmake/px4_add_common_flags.cmake b/cmake/px4_add_common_flags.cmake index 71fbbf2657..cce78801f1 100644 --- a/cmake/px4_add_common_flags.cmake +++ b/cmake/px4_add_common_flags.cmake @@ -71,11 +71,11 @@ function(px4_add_common_flags) -Werror -Warray-bounds - -Wcast-align + #-Wcast-align # TODO -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors - -Wfloat-equal + #-Wfloat-equal -Wformat-security -Winit-self -Wlogical-op @@ -156,9 +156,6 @@ function(px4_add_common_flags) # CXX only flags set(cxx_flags) list(APPEND cxx_flags - -fno-exceptions - -fno-threadsafe-statics - -Wreorder # disabled warnings @@ -175,16 +172,19 @@ function(px4_add_common_flags) add_compile_options($<$:${flag}>) endforeach() + if(NOT (${PX4_PLATFORM} MATCHES "ros2")) # TODO: fix + include_directories( + ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/${PX4_CHIP_MANUFACTURER}/${PX4_CHIP}/include + ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/common/include + ${PX4_SOURCE_DIR}/platforms/common + ${PX4_SOURCE_DIR}/platforms/common/include + ) + endif() include_directories( ${PX4_BINARY_DIR} ${PX4_BINARY_DIR}/src/lib - ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/${PX4_CHIP_MANUFACTURER}/${PX4_CHIP}/include - ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/common/include - ${PX4_SOURCE_DIR}/platforms/common - ${PX4_SOURCE_DIR}/platforms/common/include - ${PX4_SOURCE_DIR}/src ${PX4_SOURCE_DIR}/src/include ${PX4_SOURCE_DIR}/src/lib diff --git a/cmake/px4_add_library.cmake b/cmake/px4_add_library.cmake index dc5190c565..f00c203b8e 100644 --- a/cmake/px4_add_library.cmake +++ b/cmake/px4_add_library.cmake @@ -39,7 +39,10 @@ include(px4_list_make_absolute) # Like add_library but with PX4 platform dependencies # function(px4_add_library target) - add_library(${target} EXCLUDE_FROM_ALL ${ARGN}) + add_library(${target} STATIC + EXCLUDE_FROM_ALL + ${ARGN} + ) target_compile_definitions(${target} PRIVATE MODULE_NAME="${target}") diff --git a/cmake/px4_add_module.cmake b/cmake/px4_add_module.cmake index 4a6bcef6a0..7dfb3b7273 100644 --- a/cmake/px4_add_module.cmake +++ b/cmake/px4_add_module.cmake @@ -48,6 +48,7 @@ include(px4_list_make_absolute) # [ DEPENDS ] # [ SRCS ] # [ MODULE_CONFIG ] +# [ PUBLICATIONS ] # [ EXTERNAL ] # [ DYNAMIC ] # ) @@ -64,6 +65,8 @@ include(px4_list_make_absolute) # MODULE_CONFIG : yaml config file(s) # INCLUDES : include directories # DEPENDS : targets which this module depends on +# PUBLICATIONS : List of publications from this module +# SUBSCRIPTIONS : List of subsriptions used by this module # EXTERNAL : flag to indicate that this module is out-of-tree # DYNAMIC : don't compile into the px4 binary, but build a separate dynamically loadable module (posix) # UNITY_BUILD : merge all source files and build this module as a single compilation unit @@ -86,7 +89,7 @@ function(px4_add_module) px4_parse_function_args( NAME px4_add_module ONE_VALUE MODULE MAIN STACK_MAIN STACK_MAX PRIORITY - MULTI_VALUE COMPILE_FLAGS LINK_FLAGS SRCS INCLUDES DEPENDS MODULE_CONFIG + MULTI_VALUE COMPILE_FLAGS LINK_FLAGS SRCS INCLUDES DEPENDS MODULE_CONFIG PUBLICATIONS SUBSCRIPTIONS OPTIONS EXTERNAL DYNAMIC UNITY_BUILD REQUIRED MODULE MAIN ARGN ${ARGN}) @@ -165,7 +168,7 @@ function(px4_add_module) # set defaults if not set set(MAIN_DEFAULT MAIN-NOTFOUND) - set(STACK_MAIN_DEFAULT 2048) + set(STACK_MAIN_DEFAULT 4096) set(PRIORITY_DEFAULT SCHED_PRIORITY_DEFAULT) foreach(property MAIN STACK_MAIN PRIORITY) @@ -214,7 +217,21 @@ function(px4_add_module) endforeach() endif() - foreach (prop LINK_FLAGS STACK_MAIN MAIN PRIORITY) + if(PUBLICATIONS) + foreach(publication ${PUBLICATIONS}) + #message(STATUS "${MODULE} PUBLICATION: ${publication}") + set_property(GLOBAL APPEND PROPERTY PX4_PUBLICATIONS ${publication}) + endforeach() + endif() + + if(SUBSCRIPTIONS) + foreach(subscription ${SUBSCRIPTIONS}) + #message(STATUS "${MODULE} SUBSCRIPTION: ${subscription}") + set_property(GLOBAL APPEND PROPERTY PX4_SUBSCRIPTIONS ${subscription}) + endforeach() + endif() + + foreach(prop LINK_FLAGS STACK_MAIN MAIN PRIORITY) if (${prop}) set_target_properties(${MODULE} PROPERTIES ${prop} ${${prop}}) endif() diff --git a/cmake/px4_config.cmake b/cmake/px4_config.cmake index 41ea7b8c07..3c8ca6eee7 100644 --- a/cmake/px4_config.cmake +++ b/cmake/px4_config.cmake @@ -63,9 +63,9 @@ if(NOT PX4_CONFIG_FILE) ) set(PX4_CONFIG_FILE "${PX4_SOURCE_DIR}/boards/${filename}" CACHE FILEPATH "path to PX4 CONFIG file" FORCE) set(PX4_BOARD_DIR "${PX4_SOURCE_DIR}/boards/${vendor}/${model}" CACHE STRING "PX4 board directory" FORCE) - set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE) - set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE) - set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE) + set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE) + set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE) + set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE) break() endif() @@ -76,9 +76,9 @@ if(NOT PX4_CONFIG_FILE) ) set(PX4_CONFIG_FILE "${PX4_SOURCE_DIR}/boards/${filename}" CACHE FILEPATH "path to PX4 CONFIG file" FORCE) set(PX4_BOARD_DIR "${PX4_SOURCE_DIR}/boards/${vendor}/${model}" CACHE STRING "PX4 board directory" FORCE) - set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE) - set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE) - set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE) + set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE) + set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE) + set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE) break() endif() endif() diff --git a/launch/multi_uav_mavros_sitl.launch b/launch/multi_uav_mavros_sitl.launch deleted file mode 100644 index c699d72ea6..0000000000 --- a/launch/multi_uav_mavros_sitl.launch +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/multi_uav_mavros_sitl_sdf.launch b/launch/multi_uav_mavros_sitl_sdf.launch deleted file mode 100644 index 13b0534850..0000000000 --- a/launch/multi_uav_mavros_sitl_sdf.launch +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/pub_test.launch b/launch/pub_test.launch deleted file mode 100644 index 769a51aa9c..0000000000 --- a/launch/pub_test.launch +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/launch/px4.launch b/launch/px4.launch deleted file mode 100644 index 8bb60f2175..0000000000 --- a/launch/px4.launch +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/launch/single_vehicle_spawn.launch b/launch/single_vehicle_spawn.launch deleted file mode 100644 index 9c690af23a..0000000000 --- a/launch/single_vehicle_spawn.launch +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/single_vehicle_spawn_sdf.launch b/launch/single_vehicle_spawn_sdf.launch deleted file mode 100644 index f768f0d1a6..0000000000 --- a/launch/single_vehicle_spawn_sdf.launch +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/msg/action_request.msg b/msg/ActionRequest.msg similarity index 100% rename from msg/action_request.msg rename to msg/ActionRequest.msg diff --git a/msg/actuator_armed.msg b/msg/ActuatorArmed.msg similarity index 100% rename from msg/actuator_armed.msg rename to msg/ActuatorArmed.msg diff --git a/msg/actuator_controls.msg b/msg/ActuatorControls.msg similarity index 79% rename from msg/actuator_controls.msg rename to msg/ActuatorControls.msg index 25ff45f432..0e9eb98dd5 100644 --- a/msg/actuator_controls.msg +++ b/msg/ActuatorControls.msg @@ -20,6 +20,3 @@ uint8 GROUP_INDEX_PAYLOAD = 6 uint64 timestamp_sample # the timestamp the data this control response is based on was sampled float32[8] control - -# TOPICS actuator_controls actuator_controls_0 actuator_controls_1 actuator_controls_2 actuator_controls_3 -# TOPICS actuator_controls_virtual_fw actuator_controls_virtual_mc diff --git a/msg/actuator_controls_status.msg b/msg/ActuatorControlsStatus.msg similarity index 66% rename from msg/actuator_controls_status.msg rename to msg/ActuatorControlsStatus.msg index 4e3bf83450..98364042ac 100644 --- a/msg/actuator_controls_status.msg +++ b/msg/ActuatorControlsStatus.msg @@ -6,5 +6,3 @@ uint8 INDEX_YAW = 2 uint8 INDEX_THROTTLE = 3 float32[4] control_power - -# TOPICS actuator_controls_status actuator_controls_status_0 actuator_controls_status_1 diff --git a/msg/actuator_motors.msg b/msg/ActuatorMotors.msg similarity index 100% rename from msg/actuator_motors.msg rename to msg/ActuatorMotors.msg diff --git a/msg/actuator_outputs.msg b/msg/ActuatorOutputs.msg similarity index 100% rename from msg/actuator_outputs.msg rename to msg/ActuatorOutputs.msg diff --git a/msg/actuator_servos.msg b/msg/ActuatorServos.msg similarity index 100% rename from msg/actuator_servos.msg rename to msg/ActuatorServos.msg diff --git a/msg/actuator_servos_trim.msg b/msg/ActuatorServosTrim.msg similarity index 100% rename from msg/actuator_servos_trim.msg rename to msg/ActuatorServosTrim.msg diff --git a/msg/actuator_test.msg b/msg/ActuatorTest.msg similarity index 100% rename from msg/actuator_test.msg rename to msg/ActuatorTest.msg diff --git a/msg/adc_report.msg b/msg/AdcReport.msg similarity index 100% rename from msg/adc_report.msg rename to msg/AdcReport.msg diff --git a/msg/airspeed.msg b/msg/Airspeed.msg similarity index 100% rename from msg/airspeed.msg rename to msg/Airspeed.msg diff --git a/msg/airspeed_validated.msg b/msg/AirspeedValidated.msg similarity index 100% rename from msg/airspeed_validated.msg rename to msg/AirspeedValidated.msg diff --git a/msg/airspeed_wind.msg b/msg/AirspeedWind.msg similarity index 100% rename from msg/airspeed_wind.msg rename to msg/AirspeedWind.msg diff --git a/msg/autotune_attitude_control_status.msg b/msg/AutotuneAttitudeControlStatus.msg similarity index 100% rename from msg/autotune_attitude_control_status.msg rename to msg/AutotuneAttitudeControlStatus.msg diff --git a/msg/battery_status.msg b/msg/BatteryStatus.msg similarity index 100% rename from msg/battery_status.msg rename to msg/BatteryStatus.msg diff --git a/msg/CMakeLists.txt b/msg/CMakeLists.txt index ff74b99ef7..492b2b56b4 100644 --- a/msg/CMakeLists.txt +++ b/msg/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2016 PX4 Development Team. All rights reserved. +# Copyright (c) 2016-2022 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -37,212 +37,178 @@ cmake_policy(SET CMP0057 NEW) include(px4_list_make_absolute) set(msg_files - action_request.msg - actuator_armed.msg - actuator_controls.msg - actuator_controls_status.msg - actuator_motors.msg - actuator_outputs.msg - actuator_servos.msg - actuator_servos_trim.msg - actuator_test.msg - adc_report.msg - airspeed.msg - airspeed_validated.msg - airspeed_wind.msg - autotune_attitude_control_status.msg - battery_status.msg - camera_capture.msg - camera_status.msg - camera_trigger.msg - cellular_status.msg - collision_constraints.msg - collision_report.msg - commander_state.msg - control_allocator_status.msg - cpuload.msg - differential_pressure.msg - distance_sensor.msg - ekf2_timestamps.msg - ekf_gps_drift.msg - esc_report.msg - esc_status.msg - estimator_baro_bias.msg - estimator_event_flags.msg - estimator_innovations.msg - estimator_optical_flow_vel.msg - estimator_selector_status.msg - estimator_sensor_bias.msg - estimator_states.msg - estimator_status.msg - estimator_status_flags.msg - event.msg - follow_target.msg - failure_detector_status.msg - generator_status.msg - geofence_result.msg - gimbal_device_attitude_status.msg - gimbal_device_information.msg - gimbal_device_set_attitude.msg - gimbal_manager_information.msg - gimbal_manager_set_attitude.msg - gimbal_manager_set_manual_control.msg - gimbal_manager_status.msg - gps_dump.msg - gps_inject_data.msg - heater_status.msg - home_position.msg - hover_thrust_estimate.msg - internal_combustion_engine_status.msg - input_rc.msg - iridiumsbd_status.msg - irlock_report.msg - landing_gear.msg - landing_target_innovations.msg - landing_target_pose.msg - led_control.msg - log_message.msg - logger_status.msg - mag_worker_data.msg - magnetometer_bias_estimate.msg - manual_control_setpoint.msg - manual_control_switches.msg - mavlink_log.msg - mission.msg - mission_result.msg - mount_orientation.msg - navigator_mission_item.msg - npfg_status.msg - obstacle_distance.msg - offboard_control_mode.msg - onboard_computer_status.msg - optical_flow.msg - orbit_status.msg - parameter_update.msg - ping.msg - pps_capture.msg - position_controller_landing_status.msg - position_controller_status.msg - position_setpoint.msg - position_setpoint_triplet.msg - power_button_state.msg - power_monitor.msg - pwm_input.msg - px4io_status.msg - radio_status.msg - rate_ctrl_status.msg - rc_channels.msg - rc_parameter_map.msg - rpm.msg - rtl_time_estimate.msg - safety.msg - satellite_info.msg - sensor_accel.msg - sensor_accel_fifo.msg - sensor_baro.msg - sensor_combined.msg - sensor_correction.msg - sensor_gps.msg - sensor_gyro.msg - sensor_gyro_fft.msg - sensor_gyro_fifo.msg - sensor_hygrometer.msg - sensor_mag.msg - sensor_preflight_mag.msg - sensor_selection.msg - sensors_status_imu.msg - system_power.msg - takeoff_status.msg - task_stack_info.msg - tecs_status.msg - telemetry_status.msg - test_motor.msg - timesync.msg - timesync_status.msg - trajectory_bezier.msg - trajectory_waypoint.msg - transponder_report.msg - tune_control.msg - uavcan_parameter_request.msg - uavcan_parameter_value.msg - ulog_stream.msg - ulog_stream_ack.msg - vehicle_acceleration.msg - vehicle_air_data.msg - vehicle_angular_acceleration.msg - vehicle_angular_acceleration_setpoint.msg - vehicle_angular_velocity.msg - vehicle_attitude.msg - vehicle_attitude_setpoint.msg - vehicle_command.msg - vehicle_command_ack.msg - vehicle_constraints.msg - vehicle_control_mode.msg - vehicle_global_position.msg - vehicle_gps_position.msg - vehicle_imu.msg - vehicle_imu_status.msg - vehicle_land_detected.msg - vehicle_local_position.msg - vehicle_local_position_setpoint.msg - vehicle_magnetometer.msg - vehicle_odometry.msg - vehicle_rates_setpoint.msg - vehicle_roi.msg - vehicle_status.msg - vehicle_status_flags.msg - vehicle_thrust_setpoint.msg - vehicle_torque_setpoint.msg - vehicle_trajectory_bezier.msg - vehicle_trajectory_waypoint.msg - vtol_vehicle_status.msg - wheel_encoders.msg - wind.msg - yaw_estimator_status.msg + 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 + CameraCapture.msg + CameraStatus.msg + CameraTrigger.msg + CellularStatus.msg + CollisionConstraints.msg + CollisionReport.msg + CommanderState.msg + ControlAllocatorStatus.msg + Cpuload.msg + DebugArray.msg + DebugKeyValue.msg + DebugValue.msg + DebugVect.msg + DifferentialPressure.msg + DistanceSensor.msg + Ekf2Timestamps.msg + EkfGpsDrift.msg + EscReport.msg + EscStatus.msg + EstimatorBaroBias.msg + EstimatorEventFlags.msg + EstimatorInnovations.msg + EstimatorOpticalFlowVel.msg + EstimatorSelectorStatus.msg + EstimatorSensorBias.msg + EstimatorStates.msg + EstimatorStatus.msg + EstimatorStatusFlags.msg + Event.msg + FailureDetectorStatus.msg + FollowTarget.msg + GeneratorStatus.msg + GeofenceResult.msg + GimbalDeviceAttitudeStatus.msg + GimbalDeviceInformation.msg + GimbalDeviceSetAttitude.msg + GimbalManagerInformation.msg + GimbalManagerSetAttitude.msg + GimbalManagerSetManualControl.msg + GimbalManagerStatus.msg + GpsDump.msg + GpsInjectData.msg + HeaterStatus.msg + HomePosition.msg + HoverThrustEstimate.msg + InputRc.msg + InternalCombustionEngineStatus.msg + IridiumsbdStatus.msg + IrlockReport.msg + LandingGear.msg + LandingTargetInnovations.msg + LandingTargetPose.msg + LedControl.msg + LoggerStatus.msg + LogMessage.msg + MagnetometerBiasEstimate.msg + MagWorkerData.msg + ManualControlSetpoint.msg + ManualControlSwitches.msg + MavlinkLog.msg + Mission.msg + MissionResult.msg + MountOrientation.msg + NavigatorMissionItem.msg + NpfgStatus.msg + ObstacleDistance.msg + OffboardControlMode.msg + OnboardComputerStatus.msg + OpticalFlow.msg + OrbitStatus.msg + OrbTest.msg + OrbTestLarge.msg + OrbTestMedium.msg + ParameterUpdate.msg + Ping.msg + PpsCapture.msg + PositionControllerLandingStatus.msg + PositionControllerStatus.msg + PositionSetpoint.msg + PositionSetpointTriplet.msg + PowerButtonState.msg + PowerMonitor.msg + PwmInput.msg + Px4ioStatus.msg + RadioStatus.msg + RateCtrlStatus.msg + RcChannels.msg + RcParameterMap.msg + Rpm.msg + RtlTimeEstimate.msg + Safety.msg + SatelliteInfo.msg + SensorAccel.msg + SensorAccelFifo.msg + SensorBaro.msg + SensorCombined.msg + SensorCorrection.msg + SensorGps.msg + SensorGyro.msg + SensorGyroFft.msg + SensorGyroFifo.msg + SensorHygrometer.msg + SensorMag.msg + SensorPreflightMag.msg + SensorSelection.msg + SensorsStatusImu.msg + SystemPower.msg + TakeoffStatus.msg + TaskStackInfo.msg + TecsStatus.msg + TelemetryStatus.msg + TestMotor.msg + Timesync.msg + TimesyncStatus.msg + TrajectoryBezier.msg + TrajectoryWaypoint.msg + TransponderReport.msg + TuneControl.msg + UavcanParameterRequest.msg + UavcanParameterValue.msg + UlogStream.msg + UlogStreamAck.msg + VehicleAcceleration.msg + VehicleAirData.msg + VehicleAngularAcceleration.msg + VehicleAngularAccelerationSetpoint.msg + VehicleAngularVelocity.msg + VehicleAttitude.msg + VehicleAttitudeSetpoint.msg + VehicleCommand.msg + VehicleCommandAck.msg + VehicleConstraints.msg + VehicleControlMode.msg + VehicleGlobalPosition.msg + VehicleGpsPosition.msg + VehicleImu.msg + VehicleImuStatus.msg + VehicleLandDetected.msg + VehicleLocalPosition.msg + VehicleLocalPositionSetpoint.msg + VehicleMagnetometer.msg + VehicleOdometry.msg + VehicleRatesSetpoint.msg + VehicleRoi.msg + VehicleStatus.msg + VehicleStatusFlags.msg + VehicleThrustSetpoint.msg + VehicleTorqueSetpoint.msg + VehicleTrajectoryBezier.msg + VehicleTrajectoryWaypoint.msg + VtolVehicleStatus.msg + WheelEncoders.msg + Wind.msg + YawEstimatorStatus.msg ) - -if(NOT px4_constrained_flash_build) - list(APPEND msg_files - debug_array.msg - debug_key_value.msg - debug_value.msg - debug_vect.msg - ) -endif() - -if(PX4_TESTING) - list(APPEND msg_files - orb_test.msg - orb_test_large.msg - orb_test_medium.msg - ) -endif() - list(SORT msg_files) -set(deprecated_msgs - ekf2_innovations.msg # 2019-11-22, Updated estimator interface and logging; replaced by 'estimator_innovations'. - ) - -foreach(msg IN LISTS deprecated_msgs) - if(msg IN_LIST msg_files) - get_filename_component(msg_we ${msg} NAME_WE) - list(APPEND invalid_msgs ${msg_we}) - endif() -endforeach() -if(invalid_msgs) - list(LENGTH invalid_msgs invalid_msgs_size) - if(${invalid_msgs_size} GREATER 1) - foreach(msg IN LISTS invalid_msgs) - string(CONCAT invalid_msgs_cs ${invalid_msgs_cs} "'${msg}', ") - endforeach() - STRING(REGEX REPLACE ", +$" "" invalid_msgs_cs ${invalid_msgs_cs}) - message(FATAL_ERROR "${invalid_msgs_cs} are listed as deprecated. Please use different names for the messages.") - else() - message(FATAL_ERROR "'${invalid_msgs}' is listed as deprecated. Please use a different name for the message.") - endif() -endif() - px4_list_make_absolute(msg_files ${CMAKE_CURRENT_SOURCE_DIR} ${msg_files}) if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "") @@ -257,40 +223,40 @@ if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "") endif() endif() +# set parent scope msg_files for other modules to consume (eg topic_listener) +set(msg_files ${msg_files} PARENT_SCOPE) + # headers set(msg_out_path ${PX4_BINARY_DIR}/uORB/topics) set(msg_source_out_path ${CMAKE_CURRENT_BINARY_DIR}/topics_sources) -set(uorb_headers ${msg_out_path}/uORBTopics.hpp) -set(uorb_sources ${msg_source_out_path}/uORBTopics.cpp) +set(uorb_headers) foreach(msg_file ${msg_files}) get_filename_component(msg ${msg_file} NAME_WE) + + # 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) + list(APPEND uorb_headers ${msg_out_path}/${msg}.h) - list(APPEND uorb_sources ${msg_source_out_path}/${msg}.cpp) endforeach() -if (px4_constrained_flash_build) +if(px4_constrained_flash_build) set(added_arguments --constrained-flash) endif() -# set parent scope msg_files for other modules to consume (eg topic_listener) -set(msg_files ${msg_files} PARENT_SCOPE) - # Generate uORB headers add_custom_command(OUTPUT ${uorb_headers} COMMAND ${PYTHON_EXECUTABLE} tools/px_generate_uorb_topic_files.py - --headers -f ${msg_files} -i ${CMAKE_CURRENT_SOURCE_DIR} -o ${msg_out_path} -e templates/uorb - -t ${CMAKE_CURRENT_BINARY_DIR}/tmp/headers - -q ${added_arguments} DEPENDS ${msg_files} templates/uorb/msg.h.em - templates/uorb/uORBTopics.hpp.em tools/px_generate_uorb_topic_files.py tools/px_generate_uorb_topic_helper.py COMMENT "Generating uORB topic headers" @@ -298,28 +264,3 @@ add_custom_command(OUTPUT ${uorb_headers} VERBATIM ) add_custom_target(uorb_headers DEPENDS ${uorb_headers}) - -# Generate uORB sources -add_custom_command(OUTPUT ${uorb_sources} - COMMAND ${PYTHON_EXECUTABLE} tools/px_generate_uorb_topic_files.py - --sources - -f ${msg_files} - -i ${CMAKE_CURRENT_SOURCE_DIR} - -o ${msg_source_out_path} - -e templates/uorb - -t ${CMAKE_CURRENT_BINARY_DIR}/tmp/sources - -q - ${added_arguments} - DEPENDS - ${msg_files} - templates/uorb/msg.cpp.em - templates/uorb/uORBTopics.cpp.em - tools/px_generate_uorb_topic_files.py - tools/px_generate_uorb_topic_helper.py - COMMENT "Generating uORB topic sources" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - VERBATIM - ) - -add_library(uorb_msgs ${uorb_sources}) -add_dependencies(uorb_msgs prebuild_targets uorb_headers) diff --git a/msg/camera_capture.msg b/msg/CameraCapture.msg similarity index 100% rename from msg/camera_capture.msg rename to msg/CameraCapture.msg diff --git a/msg/camera_status.msg b/msg/CameraStatus.msg similarity index 100% rename from msg/camera_status.msg rename to msg/CameraStatus.msg diff --git a/msg/camera_trigger.msg b/msg/CameraTrigger.msg similarity index 89% rename from msg/camera_trigger.msg rename to msg/CameraTrigger.msg index 0da1dd109d..abfdac6dda 100644 --- a/msg/camera_trigger.msg +++ b/msg/CameraTrigger.msg @@ -5,5 +5,3 @@ uint32 seq # Image sequence number bool feedback # Trigger feedback from camera uint32 ORB_QUEUE_LENGTH = 2 - -# TOPICS camera_trigger \ No newline at end of file diff --git a/msg/cellular_status.msg b/msg/CellularStatus.msg similarity index 100% rename from msg/cellular_status.msg rename to msg/CellularStatus.msg diff --git a/msg/collision_constraints.msg b/msg/CollisionConstraints.msg similarity index 100% rename from msg/collision_constraints.msg rename to msg/CollisionConstraints.msg diff --git a/msg/collision_report.msg b/msg/CollisionReport.msg similarity index 100% rename from msg/collision_report.msg rename to msg/CollisionReport.msg diff --git a/msg/commander_state.msg b/msg/CommanderState.msg similarity index 100% rename from msg/commander_state.msg rename to msg/CommanderState.msg diff --git a/msg/control_allocator_status.msg b/msg/ControlAllocatorStatus.msg similarity index 100% rename from msg/control_allocator_status.msg rename to msg/ControlAllocatorStatus.msg diff --git a/msg/cpuload.msg b/msg/Cpuload.msg similarity index 100% rename from msg/cpuload.msg rename to msg/Cpuload.msg diff --git a/msg/debug_array.msg b/msg/DebugArray.msg similarity index 100% rename from msg/debug_array.msg rename to msg/DebugArray.msg diff --git a/msg/debug_key_value.msg b/msg/DebugKeyValue.msg similarity index 100% rename from msg/debug_key_value.msg rename to msg/DebugKeyValue.msg diff --git a/msg/debug_value.msg b/msg/DebugValue.msg similarity index 100% rename from msg/debug_value.msg rename to msg/DebugValue.msg diff --git a/msg/debug_vect.msg b/msg/DebugVect.msg similarity index 100% rename from msg/debug_vect.msg rename to msg/DebugVect.msg diff --git a/msg/differential_pressure.msg b/msg/DifferentialPressure.msg similarity index 100% rename from msg/differential_pressure.msg rename to msg/DifferentialPressure.msg diff --git a/msg/distance_sensor.msg b/msg/DistanceSensor.msg similarity index 100% rename from msg/distance_sensor.msg rename to msg/DistanceSensor.msg diff --git a/msg/ekf2_timestamps.msg b/msg/Ekf2Timestamps.msg similarity index 100% rename from msg/ekf2_timestamps.msg rename to msg/Ekf2Timestamps.msg diff --git a/msg/ekf_gps_drift.msg b/msg/EkfGpsDrift.msg similarity index 100% rename from msg/ekf_gps_drift.msg rename to msg/EkfGpsDrift.msg diff --git a/msg/esc_report.msg b/msg/EscReport.msg similarity index 100% rename from msg/esc_report.msg rename to msg/EscReport.msg diff --git a/msg/esc_status.msg b/msg/EscStatus.msg similarity index 98% rename from msg/esc_status.msg rename to msg/EscStatus.msg index f786f6d351..491e8c35de 100644 --- a/msg/esc_status.msg +++ b/msg/EscStatus.msg @@ -25,4 +25,4 @@ uint8 esc_online_flags # Bitmask indicating which ESC is online/offline uint8 esc_armed_flags # Bitmask indicating which ESC is armed. For ESC's where the arming state is not known (returned by the ESC), the arming bits should always be set. -esc_report[8] esc +px4/EscReport[8] esc diff --git a/msg/estimator_baro_bias.msg b/msg/EstimatorBaroBias.msg similarity index 100% rename from msg/estimator_baro_bias.msg rename to msg/EstimatorBaroBias.msg diff --git a/msg/estimator_event_flags.msg b/msg/EstimatorEventFlags.msg similarity index 100% rename from msg/estimator_event_flags.msg rename to msg/EstimatorEventFlags.msg diff --git a/msg/estimator_innovations.msg b/msg/EstimatorInnovations.msg similarity index 95% rename from msg/estimator_innovations.msg rename to msg/EstimatorInnovations.msg index cb3e85a1c4..82c4d1a1aa 100644 --- a/msg/estimator_innovations.msg +++ b/msg/EstimatorInnovations.msg @@ -34,5 +34,3 @@ float32 hagl # height of ground innovation (m) and innovation variance (m**2) # The innovation test ratios are scalar values. In case the field is a vector, # the test ratio will be put in the first component of the vector. - -# TOPICS estimator_innovations estimator_innovation_variances estimator_innovation_test_ratios diff --git a/msg/estimator_optical_flow_vel.msg b/msg/EstimatorOpticalFlowVel.msg similarity index 100% rename from msg/estimator_optical_flow_vel.msg rename to msg/EstimatorOpticalFlowVel.msg diff --git a/msg/estimator_selector_status.msg b/msg/EstimatorSelectorStatus.msg similarity index 100% rename from msg/estimator_selector_status.msg rename to msg/EstimatorSelectorStatus.msg diff --git a/msg/estimator_sensor_bias.msg b/msg/EstimatorSensorBias.msg similarity index 100% rename from msg/estimator_sensor_bias.msg rename to msg/EstimatorSensorBias.msg diff --git a/msg/estimator_states.msg b/msg/EstimatorStates.msg similarity index 100% rename from msg/estimator_states.msg rename to msg/EstimatorStates.msg diff --git a/msg/estimator_status.msg b/msg/EstimatorStatus.msg similarity index 100% rename from msg/estimator_status.msg rename to msg/EstimatorStatus.msg diff --git a/msg/estimator_status_flags.msg b/msg/EstimatorStatusFlags.msg similarity index 100% rename from msg/estimator_status_flags.msg rename to msg/EstimatorStatusFlags.msg diff --git a/msg/event.msg b/msg/Event.msg similarity index 100% rename from msg/event.msg rename to msg/Event.msg diff --git a/msg/failure_detector_status.msg b/msg/FailureDetectorStatus.msg similarity index 100% rename from msg/failure_detector_status.msg rename to msg/FailureDetectorStatus.msg diff --git a/msg/follow_target.msg b/msg/FollowTarget.msg similarity index 75% rename from msg/follow_target.msg rename to msg/FollowTarget.msg index f0afe3f4b8..5999f87453 100644 --- a/msg/follow_target.msg +++ b/msg/FollowTarget.msg @@ -1,8 +1,8 @@ uint64 timestamp # time since system start (microseconds) float64 lat # target position (deg * 1e7) -float64 lon # target position (deg * 1e7) +float64 lon # target position (deg * 1e7) float32 alt # target position float32 vy # target vel in y float32 vx # target vel in x -float32 vz # target vel in z +float32 vz # target vel in z uint8 est_cap # target reporting capabilities diff --git a/msg/generator_status.msg b/msg/GeneratorStatus.msg similarity index 100% rename from msg/generator_status.msg rename to msg/GeneratorStatus.msg diff --git a/msg/geofence_result.msg b/msg/GeofenceResult.msg similarity index 100% rename from msg/geofence_result.msg rename to msg/GeofenceResult.msg diff --git a/msg/gimbal_device_attitude_status.msg b/msg/GimbalDeviceAttitudeStatus.msg similarity index 100% rename from msg/gimbal_device_attitude_status.msg rename to msg/GimbalDeviceAttitudeStatus.msg diff --git a/msg/gimbal_device_information.msg b/msg/GimbalDeviceInformation.msg similarity index 100% rename from msg/gimbal_device_information.msg rename to msg/GimbalDeviceInformation.msg diff --git a/msg/gimbal_device_set_attitude.msg b/msg/GimbalDeviceSetAttitude.msg similarity index 100% rename from msg/gimbal_device_set_attitude.msg rename to msg/GimbalDeviceSetAttitude.msg diff --git a/msg/gimbal_manager_information.msg b/msg/GimbalManagerInformation.msg similarity index 100% rename from msg/gimbal_manager_information.msg rename to msg/GimbalManagerInformation.msg diff --git a/msg/gimbal_manager_set_attitude.msg b/msg/GimbalManagerSetAttitude.msg similarity index 100% rename from msg/gimbal_manager_set_attitude.msg rename to msg/GimbalManagerSetAttitude.msg diff --git a/msg/gimbal_manager_set_manual_control.msg b/msg/GimbalManagerSetManualControl.msg similarity index 100% rename from msg/gimbal_manager_set_manual_control.msg rename to msg/GimbalManagerSetManualControl.msg diff --git a/msg/gimbal_manager_status.msg b/msg/GimbalManagerStatus.msg similarity index 100% rename from msg/gimbal_manager_status.msg rename to msg/GimbalManagerStatus.msg diff --git a/msg/gps_dump.msg b/msg/GpsDump.msg similarity index 100% rename from msg/gps_dump.msg rename to msg/GpsDump.msg diff --git a/msg/gps_inject_data.msg b/msg/GpsInjectData.msg similarity index 100% rename from msg/gps_inject_data.msg rename to msg/GpsInjectData.msg diff --git a/msg/heater_status.msg b/msg/HeaterStatus.msg similarity index 100% rename from msg/heater_status.msg rename to msg/HeaterStatus.msg diff --git a/msg/home_position.msg b/msg/HomePosition.msg similarity index 100% rename from msg/home_position.msg rename to msg/HomePosition.msg diff --git a/msg/hover_thrust_estimate.msg b/msg/HoverThrustEstimate.msg similarity index 100% rename from msg/hover_thrust_estimate.msg rename to msg/HoverThrustEstimate.msg diff --git a/msg/input_rc.msg b/msg/InputRc.msg similarity index 100% rename from msg/input_rc.msg rename to msg/InputRc.msg diff --git a/msg/internal_combustion_engine_status.msg b/msg/InternalCombustionEngineStatus.msg similarity index 100% rename from msg/internal_combustion_engine_status.msg rename to msg/InternalCombustionEngineStatus.msg diff --git a/msg/iridiumsbd_status.msg b/msg/IridiumsbdStatus.msg similarity index 100% rename from msg/iridiumsbd_status.msg rename to msg/IridiumsbdStatus.msg diff --git a/msg/irlock_report.msg b/msg/IrlockReport.msg similarity index 100% rename from msg/irlock_report.msg rename to msg/IrlockReport.msg diff --git a/msg/landing_gear.msg b/msg/LandingGear.msg similarity index 100% rename from msg/landing_gear.msg rename to msg/LandingGear.msg diff --git a/msg/landing_target_innovations.msg b/msg/LandingTargetInnovations.msg similarity index 100% rename from msg/landing_target_innovations.msg rename to msg/LandingTargetInnovations.msg diff --git a/msg/landing_target_pose.msg b/msg/LandingTargetPose.msg similarity index 100% rename from msg/landing_target_pose.msg rename to msg/LandingTargetPose.msg diff --git a/msg/led_control.msg b/msg/LedControl.msg similarity index 100% rename from msg/led_control.msg rename to msg/LedControl.msg diff --git a/msg/log_message.msg b/msg/LogMessage.msg similarity index 100% rename from msg/log_message.msg rename to msg/LogMessage.msg diff --git a/msg/logger_status.msg b/msg/LoggerStatus.msg similarity index 100% rename from msg/logger_status.msg rename to msg/LoggerStatus.msg diff --git a/msg/mag_worker_data.msg b/msg/MagWorkerData.msg similarity index 100% rename from msg/mag_worker_data.msg rename to msg/MagWorkerData.msg diff --git a/msg/magnetometer_bias_estimate.msg b/msg/MagnetometerBiasEstimate.msg similarity index 100% rename from msg/magnetometer_bias_estimate.msg rename to msg/MagnetometerBiasEstimate.msg diff --git a/msg/manual_control_setpoint.msg b/msg/ManualControlSetpoint.msg similarity index 97% rename from msg/manual_control_setpoint.msg rename to msg/ManualControlSetpoint.msg index bbbdd0bc66..68232b087c 100644 --- a/msg/manual_control_setpoint.msg +++ b/msg/ManualControlSetpoint.msg @@ -52,5 +52,3 @@ float32 aux5 float32 aux6 bool sticks_moving - -# TOPICS manual_control_setpoint manual_control_input diff --git a/msg/manual_control_switches.msg b/msg/ManualControlSwitches.msg similarity index 100% rename from msg/manual_control_switches.msg rename to msg/ManualControlSwitches.msg diff --git a/msg/mavlink_log.msg b/msg/MavlinkLog.msg similarity index 100% rename from msg/mavlink_log.msg rename to msg/MavlinkLog.msg diff --git a/msg/mission.msg b/msg/Mission.msg similarity index 100% rename from msg/mission.msg rename to msg/Mission.msg diff --git a/msg/mission_result.msg b/msg/MissionResult.msg similarity index 100% rename from msg/mission_result.msg rename to msg/MissionResult.msg diff --git a/msg/mount_orientation.msg b/msg/MountOrientation.msg similarity index 100% rename from msg/mount_orientation.msg rename to msg/MountOrientation.msg diff --git a/msg/navigator_mission_item.msg b/msg/NavigatorMissionItem.msg similarity index 100% rename from msg/navigator_mission_item.msg rename to msg/NavigatorMissionItem.msg diff --git a/msg/npfg_status.msg b/msg/NpfgStatus.msg similarity index 100% rename from msg/npfg_status.msg rename to msg/NpfgStatus.msg diff --git a/msg/obstacle_distance.msg b/msg/ObstacleDistance.msg similarity index 96% rename from msg/obstacle_distance.msg rename to msg/ObstacleDistance.msg index e3c4963ab2..2bd8800d44 100644 --- a/msg/obstacle_distance.msg +++ b/msg/ObstacleDistance.msg @@ -20,5 +20,3 @@ uint16 min_distance # Minimum distance the sensor can measure in centimeters. uint16 max_distance # Maximum distance the sensor can measure in centimeters. float32 angle_offset # Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive values are offsets to the right. - -# TOPICS obstacle_distance obstacle_distance_fused diff --git a/msg/offboard_control_mode.msg b/msg/OffboardControlMode.msg similarity index 100% rename from msg/offboard_control_mode.msg rename to msg/OffboardControlMode.msg diff --git a/msg/onboard_computer_status.msg b/msg/OnboardComputerStatus.msg similarity index 100% rename from msg/onboard_computer_status.msg rename to msg/OnboardComputerStatus.msg diff --git a/msg/optical_flow.msg b/msg/OpticalFlow.msg similarity index 100% rename from msg/optical_flow.msg rename to msg/OpticalFlow.msg diff --git a/msg/OrbTest.msg b/msg/OrbTest.msg new file mode 100644 index 0000000000..77fcca6e5b --- /dev/null +++ b/msg/OrbTest.msg @@ -0,0 +1,3 @@ +uint64 timestamp # time since system start (microseconds) + +int32 val diff --git a/msg/orb_test_large.msg b/msg/OrbTestLarge.msg similarity index 100% rename from msg/orb_test_large.msg rename to msg/OrbTestLarge.msg diff --git a/msg/orb_test.msg b/msg/OrbTestMedium.msg similarity index 68% rename from msg/orb_test.msg rename to msg/OrbTestMedium.msg index bbbca412fd..fe6f989313 100644 --- a/msg/orb_test.msg +++ b/msg/OrbTestMedium.msg @@ -2,4 +2,4 @@ uint64 timestamp # time since system start (microseconds) int32 val -# TOPICS orb_test orb_multitest +uint8[64] junk diff --git a/msg/orbit_status.msg b/msg/OrbitStatus.msg similarity index 100% rename from msg/orbit_status.msg rename to msg/OrbitStatus.msg diff --git a/msg/parameter_update.msg b/msg/ParameterUpdate.msg similarity index 100% rename from msg/parameter_update.msg rename to msg/ParameterUpdate.msg diff --git a/msg/ping.msg b/msg/Ping.msg similarity index 100% rename from msg/ping.msg rename to msg/Ping.msg diff --git a/msg/position_controller_landing_status.msg b/msg/PositionControllerLandingStatus.msg similarity index 100% rename from msg/position_controller_landing_status.msg rename to msg/PositionControllerLandingStatus.msg diff --git a/msg/position_controller_status.msg b/msg/PositionControllerStatus.msg similarity index 100% rename from msg/position_controller_status.msg rename to msg/PositionControllerStatus.msg diff --git a/msg/position_setpoint.msg b/msg/PositionSetpoint.msg similarity index 100% rename from msg/position_setpoint.msg rename to msg/PositionSetpoint.msg diff --git a/msg/position_setpoint_triplet.msg b/msg/PositionSetpointTriplet.msg similarity index 67% rename from msg/position_setpoint_triplet.msg rename to msg/PositionSetpointTriplet.msg index 7c9a2ca78b..e76bc3e9db 100644 --- a/msg/position_setpoint_triplet.msg +++ b/msg/PositionSetpointTriplet.msg @@ -3,6 +3,6 @@ uint64 timestamp # time since system start (microseconds) -px4/position_setpoint previous -px4/position_setpoint current -px4/position_setpoint next +px4/PositionSetpoint previous +px4/PositionSetpoint current +px4/PositionSetpoint next diff --git a/msg/power_button_state.msg b/msg/PowerButtonState.msg similarity index 100% rename from msg/power_button_state.msg rename to msg/PowerButtonState.msg diff --git a/msg/power_monitor.msg b/msg/PowerMonitor.msg similarity index 100% rename from msg/power_monitor.msg rename to msg/PowerMonitor.msg diff --git a/msg/pps_capture.msg b/msg/PpsCapture.msg similarity index 100% rename from msg/pps_capture.msg rename to msg/PpsCapture.msg diff --git a/msg/pwm_input.msg b/msg/PwmInput.msg similarity index 100% rename from msg/pwm_input.msg rename to msg/PwmInput.msg diff --git a/msg/px4io_status.msg b/msg/Px4ioStatus.msg similarity index 100% rename from msg/px4io_status.msg rename to msg/Px4ioStatus.msg diff --git a/msg/radio_status.msg b/msg/RadioStatus.msg similarity index 100% rename from msg/radio_status.msg rename to msg/RadioStatus.msg diff --git a/msg/rate_ctrl_status.msg b/msg/RateCtrlStatus.msg similarity index 100% rename from msg/rate_ctrl_status.msg rename to msg/RateCtrlStatus.msg diff --git a/msg/rc_channels.msg b/msg/RcChannels.msg similarity index 100% rename from msg/rc_channels.msg rename to msg/RcChannels.msg diff --git a/msg/rc_parameter_map.msg b/msg/RcParameterMap.msg similarity index 100% rename from msg/rc_parameter_map.msg rename to msg/RcParameterMap.msg diff --git a/msg/rpm.msg b/msg/Rpm.msg similarity index 100% rename from msg/rpm.msg rename to msg/Rpm.msg diff --git a/msg/rtl_time_estimate.msg b/msg/RtlTimeEstimate.msg similarity index 100% rename from msg/rtl_time_estimate.msg rename to msg/RtlTimeEstimate.msg diff --git a/msg/safety.msg b/msg/Safety.msg similarity index 100% rename from msg/safety.msg rename to msg/Safety.msg diff --git a/msg/satellite_info.msg b/msg/SatelliteInfo.msg similarity index 100% rename from msg/satellite_info.msg rename to msg/SatelliteInfo.msg diff --git a/msg/sensor_accel.msg b/msg/SensorAccel.msg similarity index 100% rename from msg/sensor_accel.msg rename to msg/SensorAccel.msg diff --git a/msg/sensor_accel_fifo.msg b/msg/SensorAccelFifo.msg similarity index 100% rename from msg/sensor_accel_fifo.msg rename to msg/SensorAccelFifo.msg diff --git a/msg/sensor_baro.msg b/msg/SensorBaro.msg similarity index 100% rename from msg/sensor_baro.msg rename to msg/SensorBaro.msg diff --git a/msg/sensor_combined.msg b/msg/SensorCombined.msg similarity index 100% rename from msg/sensor_combined.msg rename to msg/SensorCombined.msg diff --git a/msg/sensor_correction.msg b/msg/SensorCorrection.msg similarity index 100% rename from msg/sensor_correction.msg rename to msg/SensorCorrection.msg diff --git a/msg/sensor_gps.msg b/msg/SensorGps.msg similarity index 100% rename from msg/sensor_gps.msg rename to msg/SensorGps.msg diff --git a/msg/sensor_gyro.msg b/msg/SensorGyro.msg similarity index 100% rename from msg/sensor_gyro.msg rename to msg/SensorGyro.msg diff --git a/msg/sensor_gyro_fft.msg b/msg/SensorGyroFft.msg similarity index 100% rename from msg/sensor_gyro_fft.msg rename to msg/SensorGyroFft.msg diff --git a/msg/sensor_gyro_fifo.msg b/msg/SensorGyroFifo.msg similarity index 100% rename from msg/sensor_gyro_fifo.msg rename to msg/SensorGyroFifo.msg diff --git a/msg/sensor_hygrometer.msg b/msg/SensorHygrometer.msg old mode 100755 new mode 100644 similarity index 100% rename from msg/sensor_hygrometer.msg rename to msg/SensorHygrometer.msg diff --git a/msg/sensor_mag.msg b/msg/SensorMag.msg similarity index 100% rename from msg/sensor_mag.msg rename to msg/SensorMag.msg diff --git a/msg/sensor_preflight_mag.msg b/msg/SensorPreflightMag.msg similarity index 100% rename from msg/sensor_preflight_mag.msg rename to msg/SensorPreflightMag.msg diff --git a/msg/sensor_selection.msg b/msg/SensorSelection.msg similarity index 100% rename from msg/sensor_selection.msg rename to msg/SensorSelection.msg diff --git a/msg/sensors_status_imu.msg b/msg/SensorsStatusImu.msg similarity index 100% rename from msg/sensors_status_imu.msg rename to msg/SensorsStatusImu.msg diff --git a/msg/system_power.msg b/msg/SystemPower.msg similarity index 100% rename from msg/system_power.msg rename to msg/SystemPower.msg diff --git a/msg/takeoff_status.msg b/msg/TakeoffStatus.msg similarity index 100% rename from msg/takeoff_status.msg rename to msg/TakeoffStatus.msg diff --git a/msg/task_stack_info.msg b/msg/TaskStackInfo.msg similarity index 100% rename from msg/task_stack_info.msg rename to msg/TaskStackInfo.msg diff --git a/msg/tecs_status.msg b/msg/TecsStatus.msg similarity index 100% rename from msg/tecs_status.msg rename to msg/TecsStatus.msg diff --git a/msg/telemetry_status.msg b/msg/TelemetryStatus.msg similarity index 100% rename from msg/telemetry_status.msg rename to msg/TelemetryStatus.msg diff --git a/msg/test_motor.msg b/msg/TestMotor.msg similarity index 100% rename from msg/test_motor.msg rename to msg/TestMotor.msg diff --git a/msg/timesync.msg b/msg/Timesync.msg similarity index 100% rename from msg/timesync.msg rename to msg/Timesync.msg diff --git a/msg/timesync_status.msg b/msg/TimesyncStatus.msg similarity index 100% rename from msg/timesync_status.msg rename to msg/TimesyncStatus.msg diff --git a/msg/trajectory_bezier.msg b/msg/TrajectoryBezier.msg similarity index 100% rename from msg/trajectory_bezier.msg rename to msg/TrajectoryBezier.msg diff --git a/msg/trajectory_waypoint.msg b/msg/TrajectoryWaypoint.msg similarity index 100% rename from msg/trajectory_waypoint.msg rename to msg/TrajectoryWaypoint.msg diff --git a/msg/transponder_report.msg b/msg/TransponderReport.msg similarity index 100% rename from msg/transponder_report.msg rename to msg/TransponderReport.msg diff --git a/msg/tune_control.msg b/msg/TuneControl.msg similarity index 100% rename from msg/tune_control.msg rename to msg/TuneControl.msg diff --git a/msg/uavcan_parameter_request.msg b/msg/UavcanParameterRequest.msg similarity index 100% rename from msg/uavcan_parameter_request.msg rename to msg/UavcanParameterRequest.msg diff --git a/msg/uavcan_parameter_value.msg b/msg/UavcanParameterValue.msg similarity index 100% rename from msg/uavcan_parameter_value.msg rename to msg/UavcanParameterValue.msg diff --git a/msg/ulog_stream.msg b/msg/UlogStream.msg similarity index 100% rename from msg/ulog_stream.msg rename to msg/UlogStream.msg diff --git a/msg/ulog_stream_ack.msg b/msg/UlogStreamAck.msg similarity index 100% rename from msg/ulog_stream_ack.msg rename to msg/UlogStreamAck.msg diff --git a/msg/vehicle_acceleration.msg b/msg/VehicleAcceleration.msg similarity index 100% rename from msg/vehicle_acceleration.msg rename to msg/VehicleAcceleration.msg diff --git a/msg/vehicle_air_data.msg b/msg/VehicleAirData.msg similarity index 100% rename from msg/vehicle_air_data.msg rename to msg/VehicleAirData.msg diff --git a/msg/vehicle_angular_acceleration.msg b/msg/VehicleAngularAcceleration.msg similarity index 100% rename from msg/vehicle_angular_acceleration.msg rename to msg/VehicleAngularAcceleration.msg diff --git a/msg/vehicle_angular_acceleration_setpoint.msg b/msg/VehicleAngularAccelerationSetpoint.msg similarity index 100% rename from msg/vehicle_angular_acceleration_setpoint.msg rename to msg/VehicleAngularAccelerationSetpoint.msg diff --git a/msg/vehicle_angular_velocity.msg b/msg/VehicleAngularVelocity.msg similarity index 78% rename from msg/vehicle_angular_velocity.msg rename to msg/VehicleAngularVelocity.msg index a8748772b7..547e124790 100644 --- a/msg/vehicle_angular_velocity.msg +++ b/msg/VehicleAngularVelocity.msg @@ -3,5 +3,3 @@ uint64 timestamp # time since system start (microseconds) uint64 timestamp_sample # timestamp of the data sample on which this message is based (microseconds) float32[3] xyz # Bias corrected angular velocity about the FRD body frame XYZ-axis in rad/s - -# TOPICS vehicle_angular_velocity vehicle_angular_velocity_groundtruth diff --git a/msg/vehicle_attitude.msg b/msg/VehicleAttitude.msg similarity index 80% rename from msg/vehicle_attitude.msg rename to msg/VehicleAttitude.msg index a57b7c5058..e60fb354ae 100644 --- a/msg/vehicle_attitude.msg +++ b/msg/VehicleAttitude.msg @@ -7,6 +7,3 @@ uint64 timestamp_sample # the timestamp of the raw data (microseconds) float32[4] q # Quaternion rotation from the FRD body frame to the NED earth frame float32[4] delta_q_reset # Amount by which quaternion has changed during last reset uint8 quat_reset_counter # Quaternion reset counter - -# TOPICS vehicle_attitude vehicle_attitude_groundtruth vehicle_vision_attitude -# TOPICS estimator_attitude diff --git a/msg/vehicle_attitude_setpoint.msg b/msg/VehicleAttitudeSetpoint.msg similarity index 92% rename from msg/vehicle_attitude_setpoint.msg rename to msg/VehicleAttitudeSetpoint.msg index 065fa12314..db79c9d17a 100644 --- a/msg/vehicle_attitude_setpoint.msg +++ b/msg/VehicleAttitudeSetpoint.msg @@ -23,5 +23,3 @@ uint8 apply_flaps # flap config specifier uint8 FLAPS_OFF = 0 # no flaps uint8 FLAPS_LAND = 1 # landing config flaps uint8 FLAPS_TAKEOFF = 2 # take-off config flaps - -# TOPICS vehicle_attitude_setpoint mc_virtual_attitude_setpoint fw_virtual_attitude_setpoint diff --git a/msg/vehicle_command.msg b/msg/VehicleCommand.msg similarity index 100% rename from msg/vehicle_command.msg rename to msg/VehicleCommand.msg diff --git a/msg/vehicle_command_ack.msg b/msg/VehicleCommandAck.msg similarity index 100% rename from msg/vehicle_command_ack.msg rename to msg/VehicleCommandAck.msg diff --git a/msg/vehicle_constraints.msg b/msg/VehicleConstraints.msg similarity index 100% rename from msg/vehicle_constraints.msg rename to msg/VehicleConstraints.msg diff --git a/msg/vehicle_control_mode.msg b/msg/VehicleControlMode.msg similarity index 100% rename from msg/vehicle_control_mode.msg rename to msg/VehicleControlMode.msg diff --git a/msg/vehicle_global_position.msg b/msg/VehicleGlobalPosition.msg similarity index 92% rename from msg/vehicle_global_position.msg rename to msg/VehicleGlobalPosition.msg index ce16daecc8..49002ae796 100644 --- a/msg/vehicle_global_position.msg +++ b/msg/VehicleGlobalPosition.msg @@ -24,6 +24,3 @@ float32 terrain_alt # Terrain altitude WGS84, (metres) bool terrain_alt_valid # Terrain altitude estimate is valid bool dead_reckoning # True if this position is estimated through dead-reckoning - -# TOPICS vehicle_global_position vehicle_global_position_groundtruth -# TOPICS estimator_global_position diff --git a/msg/vehicle_gps_position.msg b/msg/VehicleGpsPosition.msg similarity index 100% rename from msg/vehicle_gps_position.msg rename to msg/VehicleGpsPosition.msg diff --git a/msg/vehicle_imu.msg b/msg/VehicleImu.msg similarity index 100% rename from msg/vehicle_imu.msg rename to msg/VehicleImu.msg diff --git a/msg/vehicle_imu_status.msg b/msg/VehicleImuStatus.msg similarity index 100% rename from msg/vehicle_imu_status.msg rename to msg/VehicleImuStatus.msg diff --git a/msg/vehicle_land_detected.msg b/msg/VehicleLandDetected.msg similarity index 100% rename from msg/vehicle_land_detected.msg rename to msg/VehicleLandDetected.msg diff --git a/msg/vehicle_local_position.msg b/msg/VehicleLocalPosition.msg similarity index 97% rename from msg/vehicle_local_position.msg rename to msg/VehicleLocalPosition.msg index 981fec4ba8..a0a23ce260 100644 --- a/msg/vehicle_local_position.msg +++ b/msg/VehicleLocalPosition.msg @@ -69,6 +69,3 @@ float32 vxy_max # maximum horizontal speed - set to 0 when limiting not requi float32 vz_max # maximum vertical speed - set to 0 when limiting not required (meters/sec) float32 hagl_min # minimum height above ground level - set to 0 when limiting not required (meters) float32 hagl_max # maximum height above ground level - set to 0 when limiting not required (meters) - -# TOPICS vehicle_local_position vehicle_local_position_groundtruth -# TOPICS estimator_local_position diff --git a/msg/vehicle_local_position_setpoint.msg b/msg/VehicleLocalPositionSetpoint.msg similarity index 89% rename from msg/vehicle_local_position_setpoint.msg rename to msg/VehicleLocalPositionSetpoint.msg index 418cf5052b..1dfe4ec6c9 100644 --- a/msg/vehicle_local_position_setpoint.msg +++ b/msg/VehicleLocalPositionSetpoint.msg @@ -14,5 +14,3 @@ float32 vz # in meters/sec float32[3] acceleration # in meters/sec^2 float32[3] jerk # in meters/sec^3 float32[3] thrust # normalized thrust vector in NED - -# TOPICS vehicle_local_position_setpoint trajectory_setpoint diff --git a/msg/vehicle_magnetometer.msg b/msg/VehicleMagnetometer.msg similarity index 100% rename from msg/vehicle_magnetometer.msg rename to msg/VehicleMagnetometer.msg diff --git a/msg/vehicle_odometry.msg b/msg/VehicleOdometry.msg similarity index 95% rename from msg/vehicle_odometry.msg rename to msg/VehicleOdometry.msg index 4e2a0d13f9..e08c83261f 100644 --- a/msg/vehicle_odometry.msg +++ b/msg/VehicleOdometry.msg @@ -61,6 +61,3 @@ float32 yawspeed # Angular velocity about Z body axis # If linear velocity covariance invalid/unknown, first cell is NaN # If angular velocity covariance invalid/unknown, 16th cell is NaN float32[21] velocity_covariance - -# TOPICS vehicle_odometry vehicle_mocap_odometry vehicle_visual_odometry -# TOPICS estimator_odometry estimator_visual_odometry_aligned diff --git a/msg/vehicle_rates_setpoint.msg b/msg/VehicleRatesSetpoint.msg similarity index 100% rename from msg/vehicle_rates_setpoint.msg rename to msg/VehicleRatesSetpoint.msg diff --git a/msg/vehicle_roi.msg b/msg/VehicleRoi.msg similarity index 100% rename from msg/vehicle_roi.msg rename to msg/VehicleRoi.msg diff --git a/msg/vehicle_status.msg b/msg/VehicleStatus.msg similarity index 100% rename from msg/vehicle_status.msg rename to msg/VehicleStatus.msg diff --git a/msg/vehicle_status_flags.msg b/msg/VehicleStatusFlags.msg similarity index 100% rename from msg/vehicle_status_flags.msg rename to msg/VehicleStatusFlags.msg diff --git a/msg/vehicle_thrust_setpoint.msg b/msg/VehicleThrustSetpoint.msg similarity index 100% rename from msg/vehicle_thrust_setpoint.msg rename to msg/VehicleThrustSetpoint.msg diff --git a/msg/vehicle_torque_setpoint.msg b/msg/VehicleTorqueSetpoint.msg similarity index 100% rename from msg/vehicle_torque_setpoint.msg rename to msg/VehicleTorqueSetpoint.msg diff --git a/msg/vehicle_trajectory_bezier.msg b/msg/VehicleTrajectoryBezier.msg similarity index 86% rename from msg/vehicle_trajectory_bezier.msg rename to msg/VehicleTrajectoryBezier.msg index 421ff1a015..ae6274733e 100644 --- a/msg/vehicle_trajectory_bezier.msg +++ b/msg/VehicleTrajectoryBezier.msg @@ -12,7 +12,5 @@ uint8 POINT_4 = 4 uint8 NUMBER_POINTS = 5 -trajectory_bezier[5] control_points +px4/TrajectoryBezier[5] control_points uint8 bezier_order - -# TOPICS vehicle_trajectory_bezier diff --git a/msg/vehicle_trajectory_waypoint.msg b/msg/VehicleTrajectoryWaypoint.msg similarity index 86% rename from msg/vehicle_trajectory_waypoint.msg rename to msg/VehicleTrajectoryWaypoint.msg index 182f548d23..017f039183 100644 --- a/msg/vehicle_trajectory_waypoint.msg +++ b/msg/VehicleTrajectoryWaypoint.msg @@ -16,6 +16,4 @@ uint8 POINT_4 = 4 uint8 NUMBER_POINTS = 5 -trajectory_waypoint[5] waypoints - -# TOPICS vehicle_trajectory_waypoint vehicle_trajectory_waypoint_desired +px4/TrajectoryWaypoint[5] waypoints diff --git a/msg/vtol_vehicle_status.msg b/msg/VtolVehicleStatus.msg similarity index 100% rename from msg/vtol_vehicle_status.msg rename to msg/VtolVehicleStatus.msg diff --git a/msg/wheel_encoders.msg b/msg/WheelEncoders.msg similarity index 100% rename from msg/wheel_encoders.msg rename to msg/WheelEncoders.msg diff --git a/msg/wind.msg b/msg/Wind.msg similarity index 96% rename from msg/wind.msg rename to msg/Wind.msg index ff8b6f4535..7791159d6e 100644 --- a/msg/wind.msg +++ b/msg/Wind.msg @@ -12,5 +12,3 @@ float32 tas_innov_var # True airspeed innovation variance float32 beta_innov # Sideslip measurement innovation float32 beta_innov_var # Sideslip measurement innovation variance - -# TOPICS wind estimator_wind diff --git a/msg/yaw_estimator_status.msg b/msg/YawEstimatorStatus.msg similarity index 100% rename from msg/yaw_estimator_status.msg rename to msg/YawEstimatorStatus.msg diff --git a/msg/orb_test_medium.msg b/msg/orb_test_medium.msg deleted file mode 100644 index b25ae1c851..0000000000 --- a/msg/orb_test_medium.msg +++ /dev/null @@ -1,7 +0,0 @@ -uint64 timestamp # time since system start (microseconds) - -int32 val - -uint8[64] junk - -# TOPICS orb_test_medium orb_test_medium_multi orb_test_medium_wrap_around orb_test_medium_queue orb_test_medium_queue_poll diff --git a/msg/templates/uorb/msg.cpp.em b/msg/templates/uorb/msg.cpp.em deleted file mode 100644 index 03776549f5..0000000000 --- a/msg/templates/uorb/msg.cpp.em +++ /dev/null @@ -1,92 +0,0 @@ -@############################################### -@# -@# PX4 ROS compatible message source code -@# generation for C++ -@# -@# EmPy template for generating .h files -@# Based on the original template for ROS -@# -@############################################### -@# Start of Template -@# -@# Context: -@# - file_name_in (String) Source file -@# - spec (msggen.MsgSpec) Parsed specification of the .msg file -@# - search_path (dict) search paths for genmsg -@# - topics (List of String) multi-topic names -@# - constrained_flash set to true if flash is constrained -@############################################### -/**************************************************************************** - * - * Copyright (C) 2013-2021 PX4 Development Team. All rights reserved. - * - * 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. - * - ****************************************************************************/ - -/* Auto-generated by genmsg_cpp from file @file_name_in */ - -@{ -import genmsg.msgs - -from px_generate_uorb_topic_helper import * # this is in Tools/ - -uorb_struct = '%s_s'%spec.short_name -topic_name = spec.short_name - -sorted_fields = sorted(spec.parsed_fields(), key=sizeof_field_type, reverse=True) -struct_size, padding_end_size = add_padding_bytes(sorted_fields, search_path) -topic_fields = ["%s %s" % (convert_type(field.type, True), field.name) for field in sorted_fields] -}@ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -@# join all msg files in one line e.g: "float[3] position;float[3] velocity;bool armed" -@# This is used for the logger -constexpr char __orb_@(topic_name)_fields[] = "@( ";".join(topic_fields) );"; - -@[for multi_topic in topics]@ -ORB_DEFINE(@multi_topic, struct @uorb_struct, @(struct_size-padding_end_size), __orb_@(topic_name)_fields, static_cast(ORB_ID::@multi_topic)); -@[end for] - -void print_message(const orb_metadata *meta, const @uorb_struct& message) -{ - if (sizeof(message) != meta->o_size) { - printf("unexpected message size for %s: %zu != %i\n", meta->o_name, sizeof(message), meta->o_size); - return; - } - orb_print_message_internal(meta, &message, true); -} diff --git a/msg/templates/uorb/msg.h.em b/msg/templates/uorb/msg.h.em index 9854e1eaef..4bd9622a50 100644 --- a/msg/templates/uorb/msg.h.em +++ b/msg/templates/uorb/msg.h.em @@ -13,7 +13,7 @@ @# - file_name_in (String) Source file @# - spec (msggen.MsgSpec) Parsed specification of the .msg file @# - search_path (dict) search paths for genmsg -@# - topics (List of String) multi-topic names +@# - topics (List of String) topic names @############################################### /**************************************************************************** * @@ -52,12 +52,17 @@ @{ import genmsg.msgs +import re from px_generate_uorb_topic_helper import * # this is in Tools/ -uorb_struct = '%s_s'%spec.short_name -uorb_struct_upper = spec.short_name.upper() -topic_name = spec.short_name +px4_struct = '%s'%name_snake_case +uorb_struct = '%s_s'%name_snake_case +uorb_struct_upper = name_snake_case.upper() + +sorted_fields = sorted(spec.parsed_fields(), key=sizeof_field_type, reverse=True) +struct_size, padding_end_size = add_padding_bytes(sorted_fields, search_path) +topic_fields = ["%s %s" % (convert_type(field.type, True), field.name) for field in sorted_fields] }@ #pragma once @@ -67,6 +72,7 @@ topic_name = spec.short_name @############################## #include +#include @############################## @# Includes for dependencies @@ -77,9 +83,16 @@ for field in spec.parsed_fields(): if (not field.is_header): (package, name) = genmsg.names.package_resource_name(field.base_type) package = package or spec.package # convert '' to package + + name = re.sub(r'(?'%(name)) }@ + +#ifdef __PX4_ROS2 +namespace px4_embedded { +#endif // __PX4_ROS2 + @# Constants c style #ifndef __cplusplus @[for constant in spec.constants]@ @@ -124,14 +137,70 @@ for constant in spec.constants: print('\tstatic constexpr %s %s = %s;'%(type_px4, constant.name, int(constant.val))) } + + static constexpr char FIELDS[] = "@( ";".join(topic_fields) );"; + static constexpr size_t SIZE_NO_PADDING = @(struct_size-padding_end_size); + #endif }; -/* register this as object request broker structure */ -@[for multi_topic in topics]@ -ORB_DECLARE(@multi_topic); -@[end for] + +#if defined(__PX4_ROS2) +} // namespace px4_embedded + +#include "px4/msg/@(px4_struct).hpp" +using @(uorb_struct) = px4::msg::@(spec.short_name); + +inline px4::msg::@(spec.short_name) px4_embedded_to_ros2(const px4_embedded::@(uorb_struct)& msg_in) +{ + px4::msg::@(spec.short_name) msg_out; +@{ +for field in spec.parsed_fields(): + + #print(field, field.is_builtin, field.base_type, field.is_array, field.array_len) + + if field.is_builtin and not field.is_array: + print(" msg_out.%s = msg_in.%s;" % (field.name, field.name)) + elif field.is_builtin and field.is_array: + print(" std::copy(std::begin(msg_in.%s), std::end(msg_in.%s), msg_out.%s.begin());" % (field.name, field.name, field.name)) + elif not field.is_builtin: + #print(" msg_out.%s = px4_embedded_to_ros2(msg_in.%s);" % (field.name, field.name)) + print(" // %s.%s not printed" % (name_snake_case, field.name)) + else: + print(" #error %s.%s not printed" % (name_snake_case, field.name)) + +}@ + + return msg_out; +} + + +#else + +# ifdef __cplusplus +namespace px4 { + namespace msg { + using @(spec.short_name) = @(uorb_struct); + } // namespace msg +} // namespace px4 + +namespace px4_embedded { + using @(uorb_struct) = @(uorb_struct); +} + +# endif + +#endif // PX4_ROS2 #ifdef __cplusplus -void print_message(const orb_metadata *meta, const @uorb_struct& message); + +inline void print_message(const orb_metadata *meta, const @uorb_struct& message) +{ + if (sizeof(message) != meta->o_size) { + printf("unexpected message size for %s: %zu != %i\n", meta->o_name, sizeof(message), meta->o_size); + return; + } + orb_print_message_internal(meta, &message, true); +} + #endif diff --git a/msg/templates/uorb/uORBTopics.cpp.em b/msg/templates/uorb/uORBTopics.cpp.em index b08950bb19..bca3139eb0 100644 --- a/msg/templates/uorb/uORBTopics.cpp.em +++ b/msg/templates/uorb/uORBTopics.cpp.em @@ -1,18 +1,6 @@ -@############################################### -@# -@# EmPy template for generating uORBTopics.cpp file -@# for logging purposes -@# -@############################################### -@# Start of Template -@# -@# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@############################################### /**************************************************************************** * - * Copyright (C) 2013-2021 PX4 Development Team. All rights reserved. + * Copyright (C) 2021 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,23 +31,23 @@ * ****************************************************************************/ -#include #include -@{ -msg_names = [mn.replace(".msg", "") for mn in msgs] -msgs_count = len(msg_names) -msg_names_all = list(set(msg_names + multi_topics)) # set() filters duplicates -msg_names_all.sort() -msgs_count_all = len(msg_names_all) -}@ -@[for msg_name in msg_names]@ -#include -@[end for] + +#include "uORBTopics.hpp" + +// ORB_DEFINE(action_request, px4::msg::ActionRequest, px4_embedded::action_request_s::SIZE_NO_PADDING, px4_embedded::action_request_s::FIELDS, static_cast(ORB_ID::action_request)); +// ORB_DEFINE(actuator_armed, px4::msg::ActuatorArmed, px4_embedded::actuator_armed_s::SIZE_NO_PADDING, px4_embedded::actuator_armed_s::FIELDS, static_cast(ORB_ID::actuator_armed)); + +//const constexpr struct orb_metadata *const uorb_topics_list[ORB_TOPICS_COUNT] = { +// ORB_ID(action_request), +// ORB_ID(actuator_armed), + + + +@PX4_ORB_DEFINE_STR@ const constexpr struct orb_metadata *const uorb_topics_list[ORB_TOPICS_COUNT] = { -@[for idx, msg_name in enumerate(msg_names_all, 1)]@ - ORB_ID(@(msg_name))@[if idx != msgs_count_all], @[end if] -@[end for] +@PX4_MSG_TOPIC_ORB_ID@ }; const struct orb_metadata *const *orb_get_topics() diff --git a/msg/templates/uorb/uORBTopics.hpp.em b/msg/templates/uorb/uORBTopics.hpp.em index d278f06398..49267105c6 100644 --- a/msg/templates/uorb/uORBTopics.hpp.em +++ b/msg/templates/uorb/uORBTopics.hpp.em @@ -57,14 +57,32 @@ msgs_count_all = len(msg_names_all) #include -static constexpr size_t ORB_TOPICS_COUNT{@(msgs_count_all)}; +// TODO: ros2 friendly include paths +//#include +//#include + + +@PX4_ORB_HEADER_INCLUDE_STR@ + +static constexpr size_t ORB_TOPICS_COUNT{@PX4_ORB_TOPIC_COUNT@}; static constexpr size_t orb_topics_count() { return ORB_TOPICS_COUNT; } + +// ORB_DECLARE(action_request); +// ORB_DECLARE(actuator_armed); + +@PX4_ORB_DECLARE_STR@ + /* * Returns array of topics metadata */ extern const struct orb_metadata *const *orb_get_topics() __EXPORT; + +// enum class ORB_ID : uint8_t { +// action_request, +// actuator_armed, + enum class ORB_ID : uint8_t { @[for idx, msg_name in enumerate(msg_names_all)]@ @(msg_name) = @(idx), @@ -73,3 +91,18 @@ enum class ORB_ID : uint8_t { }; const struct orb_metadata *get_orb_meta(ORB_ID id); + + +static constexpr const char *get_topic_string(ORB_ID orb_id) +{ + switch (orb_id) { + //case ORB_ID::action_request: return "action_request"; + //case ORB_ID::actuator_armed: return "actuator_armed"; + +@[for idx, msg_name in enumerate(msg_names_all)]@ + case @(msg_name): return "@(msg_name)"; +@[end for] + } + + return nullptr; +} diff --git a/msg/tools/px_generate_uorb_topic_files.py b/msg/tools/px_generate_uorb_topic_files.py index 1872539fac..96a3a46fdb 100755 --- a/msg/tools/px_generate_uorb_topic_files.py +++ b/msg/tools/px_generate_uorb_topic_files.py @@ -34,7 +34,7 @@ """ px_generate_uorb_topic_files.py -Generates c/cpp header/source files for uorb topics from .msg (ROS syntax) +Generates c/cpp header/source files for uorb topics from .msg message files """ @@ -42,6 +42,7 @@ import os import shutil import filecmp import argparse +import re import sys try: @@ -76,93 +77,54 @@ except ImportError as e: __author__ = "Sergey Belash, Thomas Gubler, Beat Kueng" -__copyright__ = "Copyright (C) 2013-2016 PX4 Development Team." +__copyright__ = "Copyright (C) 2013-2021 PX4 Development Team." __license__ = "BSD" __email__ = "thomasgubler@gmail.com" -TEMPLATE_FILE = ['msg.h.em', 'msg.cpp.em'] -TOPICS_LIST_TEMPLATE_FILE = ['uORBTopics.hpp.em', 'uORBTopics.cpp.em'] -OUTPUT_FILE_EXT = ['.h', '.cpp'] +TEMPLATE_FILE = ['msg.h.em'] +OUTPUT_FILE_EXT = ['.h'] INCL_DEFAULT = ['std_msgs:./msg/std_msgs'] PACKAGE = 'px4' -TOPICS_TOKEN = '# TOPICS ' -IDL_TEMPLATE_FILE = 'msg.idl.em' - CONSTRAINED_FLASH = False - class MsgScope: NONE = 0 SEND = 1 RECEIVE = 2 - -def get_multi_topics(filename): - """ - Get TOPICS names from a "# TOPICS" line - """ - ofile = open(filename, 'r') - text = ofile.read() - result = [] - for each_line in text.split('\n'): - if each_line.startswith(TOPICS_TOKEN): - topic_names_str = each_line.strip() - topic_names_str = topic_names_str.replace(TOPICS_TOKEN, "") - result.extend(topic_names_str.split(" ")) - ofile.close() - return result - - -def get_msgs_list(msgdir): - """ - Makes list of msg files in the given directory - """ - return [fn for fn in os.listdir(msgdir) if fn.endswith(".msg")] - - -def generate_output_from_file(format_idx, filename, outputdir, package, templatedir, includepath): +def generate_output_from_file(filename, outputdir, package, templatedir, includepath): """ Converts a single .msg file to an uorb header/source file """ msg_context = genmsg.msg_loader.MsgContext.create_default() - full_type_name = genmsg.gentools.compute_full_type_name( - package, os.path.basename(filename)) - spec = genmsg.msg_loader.load_msg_from_file( - msg_context, filename, full_type_name) + full_type_name = genmsg.gentools.compute_full_type_name(package, os.path.basename(filename)) + + file_base_name = os.path.basename(filename).replace(".msg", "") + + full_type_name_snake = re.sub(r'(? maxinputtime: - maxinputtime = it - - # Find the most recent modification time in output dir - maxouttime = 0 - if os.path.isdir(outputdir): - for f in os.listdir(outputdir): - fni = os.path.join(outputdir, f) - if os.path.isfile(fni): - it = os.path.getmtime(fni) - if it > maxouttime: - maxouttime = it - - # Do not generate if nothing changed on the input - if (maxinputtime != 0 and maxouttime != 0 and maxinputtime < maxouttime): - return False - - includepath = INCL_DEFAULT + [':'.join([package, inputdir])] - for f in os.listdir(inputdir): - # Ignore hidden files - if f.startswith("."): - continue - - fn = os.path.join(inputdir, f) - # Only look at actual files - if not os.path.isfile(fn): - continue - - if fn[-4:].lower() != '.msg': - continue - - generate_output_from_file( - format_idx, fn, outputdir, package, templatedir, includepath) - return True - - -def copy_changed(inputdir, outputdir, prefix='', quiet=False): - """ - Copies files from inputdir to outputdir if they don't exist in - ouputdir or if their content changed - """ - - # Make sure output directory exists: - if not os.path.isdir(outputdir): - os.makedirs(outputdir) - - for input_file in os.listdir(inputdir): - fni = os.path.join(inputdir, input_file) - if os.path.isfile(fni): - # Check if input_file exists in outpoutdir, copy the file if not - fno = os.path.join(outputdir, prefix + input_file) - if not os.path.isfile(fno): - shutil.copy(fni, fno) - if not quiet: - print("{0}: new header file".format(fno)) - continue - - if os.path.getmtime(fni) > os.path.getmtime(fno): - # The file exists in inputdir and outputdir - # only copy if contents do not match - if not filecmp.cmp(fni, fno): - shutil.copy(fni, fno) - if not quiet: - print("{0}: updated".format(input_file)) - continue - - if not quiet: - print("{0}: unchanged".format(input_file)) - - -def convert_dir_save(format_idx, inputdir, outputdir, package, templatedir, temporarydir, prefix, quiet=False): - """ - Converts all .msg files in inputdir to uORB header files - Unchanged existing files are not overwritten. - """ - # Create new headers in temporary output directory - convert_dir(format_idx, inputdir, temporarydir, package, templatedir) - if generate_idx == 1: - generate_topics_list_file(inputdir, temporarydir, TOPICS_LIST_TEMPLATE_FILE[1], templatedir) - # Copy changed headers from temporary dir to output dir - copy_changed(temporarydir, outputdir, prefix, quiet) - - -def generate_topics_list_file(msgdir, outputdir, template_filename, templatedir): - # generate cpp file with topics list - msgs = get_msgs_list(msgdir) - multi_topics = [] - for msg in msgs: - msg_filename = os.path.join(msgdir, msg) - multi_topics.extend(get_multi_topics(msg_filename)) - tl_globals = {"msgs": msgs, "multi_topics": multi_topics} - tl_template_file = os.path.join(templatedir, template_filename) - tl_out_file = os.path.join(outputdir, template_filename.replace(".em", "")) - generate_by_template(tl_out_file, tl_template_file, tl_globals) - - -def generate_topics_list_file_from_files(files, outputdir, template_filename, templatedir): - # generate cpp file with topics list - filenames = [os.path.basename( - p) for p in files if os.path.basename(p).endswith(".msg")] - multi_topics = [] - for msg_filename in files: - multi_topics.extend(get_multi_topics(msg_filename)) - tl_globals = {"msgs": filenames, "multi_topics": multi_topics} - tl_template_file = os.path.join(templatedir, template_filename) - tl_out_file = os.path.join(outputdir, template_filename.replace(".em", "")) - generate_by_template(tl_out_file, tl_template_file, tl_globals) - - def append_to_include_path(path_to_append, curr_include, package): for p in path_to_append: curr_include.append('%s:%s' % (package, p)) if __name__ == "__main__": - parser = argparse.ArgumentParser( - description='Convert msg files to uorb headers/sources') - parser.add_argument('--headers', help='Generate header files', - action='store_true') - parser.add_argument('--sources', help='Generate source files', - action='store_true') - parser.add_argument('-d', dest='dir', help='directory with msg files') + parser = argparse.ArgumentParser(description='Convert msg files to uorb headers') parser.add_argument('-f', dest='file', help="files to convert (use only without -d)", nargs="+") @@ -500,14 +253,9 @@ if __name__ == "__main__": help='package name') parser.add_argument('-o', dest='outputdir', help='output directory for header files') - parser.add_argument('-t', dest='temporarydir', - help='temporary directory') parser.add_argument('-p', dest='prefix', default='', help='string added as prefix to the output file ' ' name when converting directories') - parser.add_argument('-q', dest='quiet', default=False, action='store_true', - help='string added as prefix to the output file ' - ' name when converting directories') parser.add_argument('--constrained-flash', dest='constrained_flash', default=False, action='store_true', help='set to save flash space') args = parser.parse_args() @@ -517,27 +265,6 @@ if __name__ == "__main__": CONSTRAINED_FLASH = args.constrained_flash - if args.headers: - generate_idx = 0 - elif args.sources: - generate_idx = 1 - else: - print('Error: either --headers or --sources must be specified') - exit(-1) if args.file is not None: for f in args.file: - generate_output_from_file( - generate_idx, f, args.temporarydir, args.package, args.templatedir, INCL_DEFAULT) - - generate_topics_list_file_from_files(args.file, args.outputdir, TOPICS_LIST_TEMPLATE_FILE[generate_idx], args.templatedir) - copy_changed(args.temporarydir, args.outputdir, args.prefix, args.quiet) - elif args.dir is not None: - convert_dir_save( - generate_idx, - args.dir, - args.outputdir, - args.package, - args.templatedir, - args.temporarydir, - args.prefix, - args.quiet) + generate_output_from_file(f, args.outputdir, args.package, args.templatedir, INCL_DEFAULT) diff --git a/msg/tools/px_generate_uorb_topic_helper.py b/msg/tools/px_generate_uorb_topic_helper.py index 1f90a01ddf..d2508cb64f 100644 --- a/msg/tools/px_generate_uorb_topic_helper.py +++ b/msg/tools/px_generate_uorb_topic_helper.py @@ -41,6 +41,7 @@ precompiled and thus message generation will be much faster import os import errno +import re import genmsg.msgs @@ -257,6 +258,7 @@ def print_field_def(field): type_prefix = '' if (sl_pos >= 0): type_name = type_name[sl_pos + 1:] + type_name = re.sub(r'(? - + + px4 - 1.0.0 - The PX4 Flight Stack package + 1.13.0 + PX4 Autopilot + dagar + BSD 3 - - - - Lorenz Meier + rosidl_default_generators + ament_cmake - - - - BSD + rclcpp + std_msgs + rosidl_default_runtime - - - - http://px4.io/ros + rosidl_interface_packages + ament_lint_auto + ament_lint_common - - - - - - - - - - - message_generation - - - - message_runtime - - - catkin - roscpp - rospy - std_msgs - libmavconn - tf - rostest - mav_msgs - roscpp - rospy - std_msgs - libmavconn - tf - mav_msgs - - - - - - - - + ament_cmake diff --git a/platforms/common/CMakeLists.txt b/platforms/common/CMakeLists.txt index 16e3537c02..f693a001b1 100644 --- a/platforms/common/CMakeLists.txt +++ b/platforms/common/CMakeLists.txt @@ -31,33 +31,39 @@ # ############################################################################ -set(SRCS) +if(NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader") -if(NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader") - list(APPEND SRCS - px4_log.cpp + set(SRCS) + + if(NOT "${PX4_BOARD}" MATCHES "io-v2") + list(APPEND SRCS + events.cpp + px4_log.cpp + ) + endif() + + add_library(px4_platform STATIC + board_identity.c + external_reset_lockout.cpp + i2c.cpp + i2c_spi_buses.cpp + module.cpp + px4_getopt.c + px4_cli.cpp + shutdown.cpp + spi.cpp + ${SRCS} ) + add_dependencies(px4_platform prebuild_targets) + + if(NOT "${PX4_BOARD}" MATCHES "io-v2") + add_subdirectory(uORB) + target_link_libraries(px4_platform PRIVATE uORB) + endif() + + add_subdirectory(px4_work_queue) + add_subdirectory(work_queue) +else() + add_library(px4_platform STATIC ${PX4_SOURCE_DIR}/platforms/common/empty.c) # TODO + add_dependencies(px4_platform prebuild_targets) endif() - -add_library(px4_platform - board_identity.c - events.cpp - external_reset_lockout.cpp - i2c.cpp - i2c_spi_buses.cpp - module.cpp - px4_getopt.c - px4_cli.cpp - shutdown.cpp - spi.cpp - ${SRCS} -) -add_dependencies(px4_platform prebuild_targets) - -if (NOT "${PX4_BOARD}" MATCHES "io-v2") - add_subdirectory(uORB) - target_link_libraries(px4_platform PRIVATE uORB) -endif() - -add_subdirectory(px4_work_queue) -add_subdirectory(work_queue) diff --git a/platforms/common/include/px4_platform_common/Node.hpp b/platforms/common/include/px4_platform_common/Node.hpp new file mode 100644 index 0000000000..53af88d21e --- /dev/null +++ b/platforms/common/include/px4_platform_common/Node.hpp @@ -0,0 +1,47 @@ + +#pragma once + +namespace px4 +{ + +class Node +{ +public: + explicit Node(const char *node_name) : + _name(node_name) + { + + } + + ~Node() override = default; + + + const char *get_name() const { return _name; } + + // bool get_parameter() + + +private: + + + const char *_name{nullptr}; + +}; + +}; + +// int main(int argc, char *argv[]) +// { +// rclcpp::init(argc, argv); +// rclcpp::spin(std::make_shared()); +// rclcpp::shutdown(); +// return 0; +// } + + +// #include "rclcpp_components/register_node_macro.hpp" + +// // Register the component with class_loader. +// // This acts as a sort of entry point, allowing the component to be discoverable when its library +// // is being loaded into a running process. +// RCLCPP_COMPONENTS_REGISTER_NODE(composition::Client) diff --git a/platforms/common/include/px4_platform_common/workqueue.h b/platforms/common/include/px4_platform_common/workqueue.h index 8b7ee24163..36ab23ed9f 100644 --- a/platforms/common/include/px4_platform_common/workqueue.h +++ b/platforms/common/include/px4_platform_common/workqueue.h @@ -43,7 +43,6 @@ #include #include -#include __BEGIN_DECLS diff --git a/platforms/common/uORB/Publication.hpp b/platforms/common/uORB/Publication.hpp index 7547e3b7fa..88a5e0de49 100644 --- a/platforms/common/uORB/Publication.hpp +++ b/platforms/common/uORB/Publication.hpp @@ -43,7 +43,7 @@ #include #include "uORBManager.hpp" -#include +#include namespace uORB { diff --git a/platforms/common/uORB/Subscription.hpp b/platforms/common/uORB/Subscription.hpp index 9fcad62179..33b494e696 100644 --- a/platforms/common/uORB/Subscription.hpp +++ b/platforms/common/uORB/Subscription.hpp @@ -39,7 +39,7 @@ #pragma once #include -#include +#include #include #include @@ -160,6 +160,10 @@ public: unsigned get_last_generation() const { return _last_generation; } orb_id_t get_topic() const { return get_orb_meta(_orb_id); } + ORB_ID get_topic_enum() const { return _orb_id; } + + size_t get_topic_size() const { return get_orb_meta(_orb_id)->o_size; } + protected: friend class SubscriptionCallback; diff --git a/platforms/common/uORB/SubscriptionInterval.hpp b/platforms/common/uORB/SubscriptionInterval.hpp index 31d1b0a7af..ddeda31de4 100644 --- a/platforms/common/uORB/SubscriptionInterval.hpp +++ b/platforms/common/uORB/SubscriptionInterval.hpp @@ -140,6 +140,9 @@ public: unsigned get_last_generation() const { return _subscription.get_last_generation(); } orb_id_t get_topic() const { return _subscription.get_topic(); } + ORB_ID get_topic_enum() const { return _subscription.get_topic_enum(); } + size_t get_topic_size() const { return _subscription.get_topic_size(); } + /** * Set the interval in microseconds * @param interval The interval in microseconds. diff --git a/platforms/common/uORB/uORB.h b/platforms/common/uORB/uORB.h index c96f3c08d4..702e3ebd42 100644 --- a/platforms/common/uORB/uORB.h +++ b/platforms/common/uORB/uORB.h @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2012-2015 PX4 Development Team. All rights reserved. + * Copyright (c) 2012-2021 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -251,10 +251,16 @@ void orb_print_message_internal(const struct orb_metadata *meta, const void *dat __END_DECLS /* Diverse uORB header defines */ //XXX: move to better location -#define ORB_ID_VEHICLE_ATTITUDE_CONTROLS ORB_ID(actuator_controls_0) typedef uint8_t arming_state_t; typedef uint8_t main_state_t; typedef uint8_t hil_state_t; typedef uint8_t navigation_state_t; typedef uint8_t switch_pos_t; + + +#ifdef __cplusplus + +#include + +#endif // __cplusplus diff --git a/platforms/common/uORB/uORBCommunicator.hpp b/platforms/common/uORB/uORBCommunicator.hpp index cbb996b82b..80ccb2d1ab 100644 --- a/platforms/common/uORB/uORBCommunicator.hpp +++ b/platforms/common/uORB/uORBCommunicator.hpp @@ -100,8 +100,6 @@ public: virtual int16_t add_subscription(const char *messageName, int32_t msgRateInHz) = 0; - - /** * @brief Interface to notify the remote entity of removal of a subscription * @@ -116,13 +114,11 @@ public: virtual int16_t remove_subscription(const char *messageName) = 0; - /** * Register Message Handler. This is internal for the IChannel implementer* */ virtual int16_t register_handler(uORBCommunicator::IChannelRxHandler *handler) = 0; - //========================================================================= // INTERFACES FOR Data messages //========================================================================= @@ -143,7 +139,6 @@ public: */ virtual int16_t send_message(const char *messageName, int32_t length, uint8_t *data) = 0; - }; /** @@ -153,7 +148,6 @@ public: class uORBCommunicator::IChannelRxHandler { public: - /** * Interface to process a received topic from remote. * @param topic_name @@ -184,7 +178,6 @@ public: virtual int16_t process_add_subscription(const char *messageName, int32_t msgRateInHz) = 0; - /** * Interface to process a received control msg to remove subscription * @param messageName @@ -198,7 +191,6 @@ public: virtual int16_t process_remove_subscription(const char *messageName) = 0; - /** * Interface to process the received data message. * @param messageName @@ -215,7 +207,6 @@ public: */ virtual int16_t process_received_message(const char *messageName, int32_t length, uint8_t *data) = 0; - }; #endif /* _uORBCommunicator_hpp_ */ diff --git a/platforms/common/uORB/uORBDeviceMaster.hpp b/platforms/common/uORB/uORBDeviceMaster.hpp index 94c97e61df..67c0491b3c 100644 --- a/platforms/common/uORB/uORBDeviceMaster.hpp +++ b/platforms/common/uORB/uORBDeviceMaster.hpp @@ -36,7 +36,7 @@ #include #include "uORBCommon.hpp" -#include +#include #include diff --git a/platforms/common/uORB/uORB_tests/CMakeLists.txt b/platforms/common/uORB/uORB_tests/CMakeLists.txt index ea77e368f3..0ed2bdc1be 100644 --- a/platforms/common/uORB/uORB_tests/CMakeLists.txt +++ b/platforms/common/uORB/uORB_tests/CMakeLists.txt @@ -38,4 +38,13 @@ px4_add_module( SRCS uORB_tests_main.cpp uORBTest_UnitTest.cpp + PUBLICATIONS + "px4::msg::OrbTest /orb_test" + "px4::msg::OrbTest /orb_multitest" + "px4::msg::OrbTestMedium /orb_test_medium" + "px4::msg::OrbTestMedium /orb_test_medium_multi" + "px4::msg::OrbTestMedium /orb_test_medium_queue" + "px4::msg::OrbTestMedium /orb_test_medium_queue_poll" + "px4::msg::OrbTestMedium /orb_test_medium_wrap_around" + "px4::msg::OrbTestLarge /orb_test_large" ) diff --git a/platforms/common/work_queue/CMakeLists.txt b/platforms/common/work_queue/CMakeLists.txt index 2c77023dfb..75ec99a057 100644 --- a/platforms/common/work_queue/CMakeLists.txt +++ b/platforms/common/work_queue/CMakeLists.txt @@ -32,9 +32,9 @@ ############################################################################ # nuttx uses internal work queue currently -if (NOT "${PX4_PLATFORM}" MATCHES "nuttx") +if(NOT "${PX4_PLATFORM}" MATCHES "nuttx") - add_library(work_queue + add_library(work_queue STATIC dq_addlast.c dq_rem.c dq_remfirst.c diff --git a/platforms/common/work_queue/hrt_queue.c b/platforms/common/work_queue/hrt_queue.c index 74a4a8e17b..b145da282c 100644 --- a/platforms/common/work_queue/hrt_queue.c +++ b/platforms/common/work_queue/hrt_queue.c @@ -52,30 +52,6 @@ #include #include "hrt_work.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Public Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - /**************************************************************************** * Name: hrt_work_queue * @@ -125,7 +101,7 @@ int hrt_work_queue(struct work_s *work, worker_t worker, void *arg, uint32_t del dq_addlast((dq_entry_t *)work, &wqueue->q); - if (px4_getpid() != wqueue->pid) { /* only need to wake up if called from a different thread */ + if (getpid() != wqueue->pid) { /* only need to wake up if called from a different thread */ #ifdef __PX4_QURT px4_task_kill(wqueue->pid, SIGALRM); /* Wake up the worker thread */ #else diff --git a/platforms/common/work_queue/hrt_thread.c b/platforms/common/work_queue/hrt_thread.c index 26a7e509dd..1e058cc1d4 100644 --- a/platforms/common/work_queue/hrt_thread.c +++ b/platforms/common/work_queue/hrt_thread.c @@ -96,7 +96,7 @@ static void _sighandler(int sig_num); ****************************************************************************/ static void _sighandler(int sig_num) { - PX4_DEBUG("RECEIVED SIGNAL %d", sig_num); + //PX4_DEBUG("RECEIVED SIGNAL %d", sig_num); } /**************************************************************************** @@ -176,7 +176,7 @@ static void hrt_work_process() hrt_work_unlock(); if (!worker) { - PX4_ERR("MESSED UP: worker = 0"); + //PX4_ERR("MESSED UP: worker = 0"); } else { worker(arg); diff --git a/platforms/common/work_queue/work_lock.c b/platforms/common/work_queue/work_lock.c index fb65c70a73..1a3b118f54 100644 --- a/platforms/common/work_queue/work_lock.c +++ b/platforms/common/work_queue/work_lock.c @@ -35,6 +35,7 @@ #include #include "work_lock.h" +#include extern px4_sem_t _work_lock[]; diff --git a/platforms/nuttx/CMakeLists.txt b/platforms/nuttx/CMakeLists.txt index f35b581e69..4530dc8e99 100644 --- a/platforms/nuttx/CMakeLists.txt +++ b/platforms/nuttx/CMakeLists.txt @@ -111,6 +111,8 @@ target_link_libraries(nuttx_arch arch_hrt ) +target_link_libraries(nuttx_boards INTERFACE arch_board_reset) + target_link_libraries(nuttx_c INTERFACE nuttx_drivers) target_link_libraries(nuttx_drivers INTERFACE nuttx_c) target_link_libraries(nuttx_xx INTERFACE nuttx_c) diff --git a/platforms/nuttx/cmake/px4_impl_os.cmake b/platforms/nuttx/cmake/px4_impl_os.cmake index 9627e2785e..4b275cb3e7 100644 --- a/platforms/nuttx/cmake/px4_impl_os.cmake +++ b/platforms/nuttx/cmake/px4_impl_os.cmake @@ -64,10 +64,19 @@ function(px4_os_add_flags) ${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/apps/include ) - # prevent using the toolchain's std c++ library - add_compile_options($<$:-nostdinc++>) - add_compile_options($<$:-fno-sized-deallocation>) + set(cxx_flags) + list(APPEND cxx_flags + -fno-exceptions + -fno-rtti + -fno-sized-deallocation + -fno-threadsafe-statics + -nostdinc++ # prevent using the toolchain's std c++ library + ) + + foreach(flag ${cxx_flags}) + add_compile_options($<$:${flag}>) + endforeach() add_definitions( -D__PX4_NUTTX diff --git a/platforms/nuttx/src/canbootloader/CMakeLists.txt b/platforms/nuttx/src/canbootloader/CMakeLists.txt index 8ca45a1e87..e9dfc73de8 100644 --- a/platforms/nuttx/src/canbootloader/CMakeLists.txt +++ b/platforms/nuttx/src/canbootloader/CMakeLists.txt @@ -33,7 +33,7 @@ add_subdirectory(arch/${PX4_CHIP_MANUFACTURER}) -px4_add_library(canbootloader +add_library(canbootloader common/nuttx_stubs.c fs/flash.c protocol/uavcan.c @@ -42,7 +42,7 @@ px4_add_library(canbootloader util/random.c util/cxx_init.c ) - +add_dependencies(canbootloader prebuild_targets) include_directories(include) target_include_directories(canbootloader INTERFACE include) diff --git a/platforms/nuttx/src/canbootloader/arch/nxp/s32k14x/CMakeLists.txt b/platforms/nuttx/src/canbootloader/arch/nxp/s32k14x/CMakeLists.txt index e41468fa17..d59eb2ff61 100644 --- a/platforms/nuttx/src/canbootloader/arch/nxp/s32k14x/CMakeLists.txt +++ b/platforms/nuttx/src/canbootloader/arch/nxp/s32k14x/CMakeLists.txt @@ -32,8 +32,11 @@ ############################################################################ include_directories(../../../include) -px4_add_library(arch_canbootloader + +add_library(arch_canbootloader board_identity.c drivers/can/driver.c drivers/flash/driver.c ) +target_link_libraries(arch_canbootloader PRIVATE crc) +add_dependencies(arch_canbootloader prebuild_targets) diff --git a/platforms/nuttx/src/canbootloader/arch/nxp/s32k14x/drivers/can/driver.c b/platforms/nuttx/src/canbootloader/arch/nxp/s32k14x/drivers/can/driver.c index 4ab6a987a5..cb60161b3b 100644 --- a/platforms/nuttx/src/canbootloader/arch/nxp/s32k14x/drivers/can/driver.c +++ b/platforms/nuttx/src/canbootloader/arch/nxp/s32k14x/drivers/can/driver.c @@ -53,7 +53,7 @@ #include #include "flexcan.h" -#include +#include #define CAN_TX_TIMEOUT_MS (200 /(1000/(1000000/CONFIG_USEC_PER_TICK))) diff --git a/platforms/nuttx/src/canbootloader/arch/stm/stm32f4/CMakeLists.txt b/platforms/nuttx/src/canbootloader/arch/stm/stm32f4/CMakeLists.txt index eccd131c6d..d9e1de6841 100644 --- a/platforms/nuttx/src/canbootloader/arch/stm/stm32f4/CMakeLists.txt +++ b/platforms/nuttx/src/canbootloader/arch/stm/stm32f4/CMakeLists.txt @@ -33,11 +33,11 @@ include_directories(../../../include) -px4_add_library(arch_canbootloader +add_library(arch_canbootloader board_identity.c drivers/can/driver.c ) - +add_dependencies(arch_canbootloader prebuild_targets) target_link_libraries(arch_canbootloader PRIVATE arch_watchdog_iwdg diff --git a/platforms/nuttx/src/canbootloader/arch/stm/stm32f4/drivers/can/driver.c b/platforms/nuttx/src/canbootloader/arch/stm/stm32f4/drivers/can/driver.c index c915cc0d33..265fdb103f 100644 --- a/platforms/nuttx/src/canbootloader/arch/stm/stm32f4/drivers/can/driver.c +++ b/platforms/nuttx/src/canbootloader/arch/stm/stm32f4/drivers/can/driver.c @@ -55,7 +55,7 @@ #include -#include +#include #define INAK_TIMEOUT 65535 diff --git a/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/CMakeLists.txt b/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/CMakeLists.txt index eccd131c6d..d9e1de6841 100644 --- a/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/CMakeLists.txt +++ b/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/CMakeLists.txt @@ -33,11 +33,11 @@ include_directories(../../../include) -px4_add_library(arch_canbootloader +add_library(arch_canbootloader board_identity.c drivers/can/driver.c ) - +add_dependencies(arch_canbootloader prebuild_targets) target_link_libraries(arch_canbootloader PRIVATE arch_watchdog_iwdg diff --git a/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/drivers/can/driver.c b/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/drivers/can/driver.c index 5a90ea708f..769991e539 100644 --- a/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/drivers/can/driver.c +++ b/platforms/nuttx/src/canbootloader/arch/stm/stm32f7/drivers/can/driver.c @@ -54,7 +54,7 @@ #include -#include +#include #define INAK_TIMEOUT 65535 diff --git a/platforms/nuttx/src/canbootloader/protocol/uavcan.c b/platforms/nuttx/src/canbootloader/protocol/uavcan.c index a55d03aa82..ed00ab66da 100644 --- a/platforms/nuttx/src/canbootloader/protocol/uavcan.c +++ b/platforms/nuttx/src/canbootloader/protocol/uavcan.c @@ -49,7 +49,7 @@ #include "uavcan.h" #include "can.h" -#include +#include #define CAN_REQUEST_TIMEOUT 1000 #define ANY_NODE_ID 0 diff --git a/platforms/nuttx/src/canbootloader/uavcan/main.c b/platforms/nuttx/src/canbootloader/uavcan/main.c index d634715f4a..db1f6691f9 100644 --- a/platforms/nuttx/src/canbootloader/uavcan/main.c +++ b/platforms/nuttx/src/canbootloader/uavcan/main.c @@ -58,7 +58,7 @@ #include #include #include -#include +#include //#define DEBUG_APPLICATION_INPLACE 1 /* Never leave defined */ #define DEBUG_NO_FW_UPDATE 1 /* With DEBUG_APPLICATION_INPLACE diff --git a/platforms/nuttx/src/px4/common/CMakeLists.txt b/platforms/nuttx/src/px4/common/CMakeLists.txt index 29164bf6ce..f59b502b46 100644 --- a/platforms/nuttx/src/px4/common/CMakeLists.txt +++ b/platforms/nuttx/src/px4/common/CMakeLists.txt @@ -32,9 +32,11 @@ ############################################################################ # skip for px4_layer support on an IO board -if(NOT PX4_BOARD MATCHES "io-v2") +if((NOT PX4_BOARD MATCHES "io-v2") AND (NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")) + + add_library(px4_layer STATIC + EXCLUDE_FROM_ALL - add_library(px4_layer board_crashdump.c board_dma_alloc.c board_fat_dma_alloc.c @@ -51,6 +53,7 @@ if(NOT PX4_BOARD MATCHES "io-v2") px4_24xxxx_mtd.c px4_crypto.cpp ) + target_link_libraries(px4_layer PRIVATE arch_board_reset @@ -62,14 +65,32 @@ if(NOT PX4_BOARD MATCHES "io-v2") uORB ) else() - add_library(px4_layer ${PX4_SOURCE_DIR}/platforms/common/empty.c) + + add_library(px4_layer STATIC + EXCLUDE_FROM_ALL + + ${PX4_SOURCE_DIR}/platforms/common/empty.c + + board_crashdump.c + gpio.c + ) + + target_link_libraries(px4_layer + PRIVATE + arch_board_reset + arch_board_critmon + arch_version + nuttx_sched + ) + endif() + add_dependencies(px4_layer prebuild_targets) add_subdirectory(gpio) add_subdirectory(srgbled) -if (DEFINED PX4_CRYPTO) +if(DEFINED PX4_CRYPTO) add_library(px4_random nuttx_random.c) add_dependencies(px4_random nuttx_context) target_link_libraries(px4_random PRIVATE nuttx_crypto) diff --git a/platforms/nuttx/src/px4/nxp/imxrt/hrt/CMakeLists.txt b/platforms/nuttx/src/px4/nxp/imxrt/hrt/CMakeLists.txt index 3edd775b6a..9e6514d45d 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/hrt/CMakeLists.txt +++ b/platforms/nuttx/src/px4/nxp/imxrt/hrt/CMakeLists.txt @@ -31,7 +31,8 @@ # ############################################################################ -px4_add_library(arch_hrt +add_library(arch_hrt hrt.c ) -target_compile_options(arch_hrt PRIVATE -Wno-cast-align) # TODO: fix and enable +add_dependencies(arch_hrt prebuild_targets) +target_compile_options(arch_hrt PRIVATE -Wno-cast-align ${MAX_CUSTOM_OPT_LEVEL}) # TODO: fix and enable diff --git a/platforms/nuttx/src/px4/nxp/kinetis/hrt/CMakeLists.txt b/platforms/nuttx/src/px4/nxp/kinetis/hrt/CMakeLists.txt index ebd97f8a42..9e6514d45d 100644 --- a/platforms/nuttx/src/px4/nxp/kinetis/hrt/CMakeLists.txt +++ b/platforms/nuttx/src/px4/nxp/kinetis/hrt/CMakeLists.txt @@ -31,8 +31,8 @@ # ############################################################################ -px4_add_library(arch_hrt +add_library(arch_hrt hrt.c ) -target_compile_options(arch_hrt PRIVATE -Wno-cast-align) # TODO: fix and enable - +add_dependencies(arch_hrt prebuild_targets) +target_compile_options(arch_hrt PRIVATE -Wno-cast-align ${MAX_CUSTOM_OPT_LEVEL}) # TODO: fix and enable diff --git a/platforms/nuttx/src/px4/nxp/s32k1xx/hrt/CMakeLists.txt b/platforms/nuttx/src/px4/nxp/s32k1xx/hrt/CMakeLists.txt index 3edd775b6a..9e6514d45d 100644 --- a/platforms/nuttx/src/px4/nxp/s32k1xx/hrt/CMakeLists.txt +++ b/platforms/nuttx/src/px4/nxp/s32k1xx/hrt/CMakeLists.txt @@ -31,7 +31,8 @@ # ############################################################################ -px4_add_library(arch_hrt +add_library(arch_hrt hrt.c ) -target_compile_options(arch_hrt PRIVATE -Wno-cast-align) # TODO: fix and enable +add_dependencies(arch_hrt prebuild_targets) +target_compile_options(arch_hrt PRIVATE -Wno-cast-align ${MAX_CUSTOM_OPT_LEVEL}) # TODO: fix and enable diff --git a/platforms/nuttx/src/px4/rpi/rpi_common/hrt/CMakeLists.txt b/platforms/nuttx/src/px4/rpi/rpi_common/hrt/CMakeLists.txt index 9ce26ff632..f82c0c9edc 100644 --- a/platforms/nuttx/src/px4/rpi/rpi_common/hrt/CMakeLists.txt +++ b/platforms/nuttx/src/px4/rpi/rpi_common/hrt/CMakeLists.txt @@ -31,11 +31,8 @@ # ############################################################################ -px4_add_library(arch_hrt +add_library(arch_hrt hrt.c ) -target_compile_options(arch_hrt - PRIVATE - ${MAX_CUSTOM_OPT_LEVEL} - -Wno-cast-align # TODO: fix and enable -) +add_dependencies(arch_hrt prebuild_targets) +target_compile_options(arch_hrt PRIVATE -Wno-cast-align ${MAX_CUSTOM_OPT_LEVEL}) # TODO: fix and enable diff --git a/platforms/nuttx/src/px4/stm/stm32_common/hrt/CMakeLists.txt b/platforms/nuttx/src/px4/stm/stm32_common/hrt/CMakeLists.txt index 82854e0def..9e6514d45d 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/hrt/CMakeLists.txt +++ b/platforms/nuttx/src/px4/stm/stm32_common/hrt/CMakeLists.txt @@ -31,11 +31,8 @@ # ############################################################################ -px4_add_library(arch_hrt +add_library(arch_hrt hrt.c ) -target_compile_options(arch_hrt - PRIVATE - ${MAX_CUSTOM_OPT_LEVEL} - -Wno-cast-align # TODO: fix and enable -) +add_dependencies(arch_hrt prebuild_targets) +target_compile_options(arch_hrt PRIVATE -Wno-cast-align ${MAX_CUSTOM_OPT_LEVEL}) # TODO: fix and enable diff --git a/platforms/nuttx/src/px4/stm/stm32f1/watchdog/CMakeLists.txt b/platforms/nuttx/src/px4/stm/stm32f1/watchdog/CMakeLists.txt index 3c80878d02..b78c28bb56 100644 --- a/platforms/nuttx/src/px4/stm/stm32f1/watchdog/CMakeLists.txt +++ b/platforms/nuttx/src/px4/stm/stm32f1/watchdog/CMakeLists.txt @@ -31,6 +31,7 @@ # ############################################################################ -px4_add_library(arch_watchdog_iwdg +add_library(arch_watchdog_iwdg iwdg.c ) +add_dependencies(arch_watchdog_iwdg prebuild_targets) diff --git a/platforms/nuttx/src/px4/stm/stm32f4/watchdog/CMakeLists.txt b/platforms/nuttx/src/px4/stm/stm32f4/watchdog/CMakeLists.txt index 3c80878d02..b78c28bb56 100644 --- a/platforms/nuttx/src/px4/stm/stm32f4/watchdog/CMakeLists.txt +++ b/platforms/nuttx/src/px4/stm/stm32f4/watchdog/CMakeLists.txt @@ -31,6 +31,7 @@ # ############################################################################ -px4_add_library(arch_watchdog_iwdg +add_library(arch_watchdog_iwdg iwdg.c ) +add_dependencies(arch_watchdog_iwdg prebuild_targets) diff --git a/platforms/nuttx/src/px4/stm/stm32f7/watchdog/CMakeLists.txt b/platforms/nuttx/src/px4/stm/stm32f7/watchdog/CMakeLists.txt index 3c80878d02..b78c28bb56 100644 --- a/platforms/nuttx/src/px4/stm/stm32f7/watchdog/CMakeLists.txt +++ b/platforms/nuttx/src/px4/stm/stm32f7/watchdog/CMakeLists.txt @@ -31,6 +31,7 @@ # ############################################################################ -px4_add_library(arch_watchdog_iwdg +add_library(arch_watchdog_iwdg iwdg.c ) +add_dependencies(arch_watchdog_iwdg prebuild_targets) diff --git a/platforms/posix/include/px4_platform_types.h b/platforms/posix/include/px4_platform_types.h deleted file mode 100644 index abaf177444..0000000000 --- a/platforms/posix/include/px4_platform_types.h +++ /dev/null @@ -1,3 +0,0 @@ -#ifdef __PX4_QURT -#include -#endif diff --git a/platforms/ros2/CMakeLists.txt b/platforms/ros2/CMakeLists.txt new file mode 100644 index 0000000000..9c8fd36ec0 --- /dev/null +++ b/platforms/ros2/CMakeLists.txt @@ -0,0 +1,34 @@ + +#include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES) + +# When building with catkin, do not change CMAKE_RUNTIME_OUTPUT_DIR from +# CMAKE_CURRENT_BINARY_DIR ''./platforms/posix' to './bin' +if (NOT CATKIN_DEVEL_PREFIX) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin) +endif() + + +# add_executable(px4 +# src/px4/common/main.cpp +# ) + +add_compile_options(-Wno-error) + +include_directories(${PX4_BINARY_DIR}) + +# # mc_rate_control_ros2 +# add_executable(mc_rate_control ${CMAKE_SOURCE_DIR}/src/modules/mc_rate_control_ros2/MulticopterRateControl.cpp) +# target_link_libraries(mc_rate_control px4_layer work_queue) +# ament_target_dependencies(mc_rate_control rclcpp std_msgs) +# rosidl_target_interfaces(mc_rate_control ${PROJECT_NAME} "rosidl_typesupport_cpp") +# add_dependencies(mc_rate_control generate_parameters) + +# install( +# TARGETS +# mc_rate_control +# DESTINATION lib/${PROJECT_NAME} +# ) diff --git a/platforms/ros2/cmake/Toolchain-native.cmake b/platforms/ros2/cmake/Toolchain-native.cmake new file mode 100644 index 0000000000..2899671043 --- /dev/null +++ b/platforms/ros2/cmake/Toolchain-native.cmake @@ -0,0 +1,17 @@ +# compiler tools +foreach(tool nm ld) + string(TOUPPER ${tool} TOOL) + find_program(${TOOL} ${tool}) + if(NOT ${TOOL}) + message(FATAL_ERROR "could not find ${tool}") + endif() +endforeach() + +# os tools +foreach(tool echo grep rm mkdir nm cp touch make unzip) + string(TOUPPER ${tool} TOOL) + find_program(${TOOL} ${tool}) + if(NOT ${TOOL}) + message(FATAL_ERROR "could not find ${TOOL}") + endif() +endforeach() diff --git a/platforms/ros2/cmake/finalize.cmake b/platforms/ros2/cmake/finalize.cmake new file mode 100644 index 0000000000..51291d389e --- /dev/null +++ b/platforms/ros2/cmake/finalize.cmake @@ -0,0 +1,3 @@ + + +ament_package() diff --git a/platforms/ros2/cmake/init.cmake b/platforms/ros2/cmake/init.cmake new file mode 100644 index 0000000000..cb68bfbbf5 --- /dev/null +++ b/platforms/ros2/cmake/init.cmake @@ -0,0 +1,181 @@ + +cmake_policy(SET CMP0057 NEW) # Support IN_LIST if() operator + +# find dependencies +find_package(ament_cmake REQUIRED) +find_package(rclcpp REQUIRED) +find_package(rosidl_default_generators REQUIRED) +find_package(std_msgs REQUIRED) + + +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/ActionRequest.msg" + "msg/ActuatorArmed.msg" + "msg/ActuatorControls.msg" + "msg/ActuatorControlsStatus.msg" + "msg/ActuatorMotors.msg" + "msg/ActuatorOutputs.msg" + "msg/ActuatorServos.msg" + "msg/ActuatorTest.msg" + "msg/ActuatorServosTrim.msg" + "msg/AdcReport.msg" + "msg/Airspeed.msg" + "msg/AirspeedValidated.msg" + "msg/AirspeedWind.msg" + "msg/AutotuneAttitudeControlStatus.msg" + "msg/BatteryStatus.msg" + "msg/CameraCapture.msg" + "msg/CameraStatus.msg" + "msg/CameraTrigger.msg" + "msg/CellularStatus.msg" + "msg/CollisionConstraints.msg" + "msg/CollisionReport.msg" + "msg/CommanderState.msg" + "msg/ControlAllocatorStatus.msg" + "msg/Cpuload.msg" + "msg/DebugArray.msg" + "msg/DebugKeyValue.msg" + "msg/DebugValue.msg" + "msg/DebugVect.msg" + "msg/DifferentialPressure.msg" + "msg/DistanceSensor.msg" + "msg/Ekf2Timestamps.msg" + "msg/EkfGpsDrift.msg" + "msg/EscReport.msg" + "msg/EscStatus.msg" + "msg/EstimatorBaroBias.msg" + "msg/EstimatorEventFlags.msg" + "msg/EstimatorInnovations.msg" + "msg/EstimatorOpticalFlowVel.msg" + "msg/EstimatorSelectorStatus.msg" + "msg/EstimatorSensorBias.msg" + "msg/EstimatorStates.msg" + "msg/EstimatorStatus.msg" + "msg/EstimatorStatusFlags.msg" + "msg/Event.msg" + "msg/FailureDetectorStatus.msg" + "msg/FollowTarget.msg" + "msg/GeneratorStatus.msg" + "msg/GeofenceResult.msg" + "msg/GimbalDeviceAttitudeStatus.msg" + "msg/GimbalDeviceInformation.msg" + "msg/GimbalDeviceSetAttitude.msg" + "msg/GimbalManagerInformation.msg" + "msg/GimbalManagerSetAttitude.msg" + "msg/GimbalManagerSetManualControl.msg" + "msg/GimbalManagerStatus.msg" + "msg/GpsDump.msg" + "msg/GpsInjectData.msg" + "msg/HeaterStatus.msg" + "msg/HomePosition.msg" + "msg/HoverThrustEstimate.msg" + "msg/InputRc.msg" + "msg/InternalCombustionEngineStatus.msg" + "msg/IridiumsbdStatus.msg" + "msg/IrlockReport.msg" + "msg/LandingGear.msg" + "msg/LandingTargetInnovations.msg" + "msg/LandingTargetPose.msg" + "msg/LedControl.msg" + "msg/LoggerStatus.msg" + "msg/LogMessage.msg" + "msg/MagnetometerBiasEstimate.msg" + "msg/MagWorkerData.msg" + "msg/ManualControlSetpoint.msg" + "msg/ManualControlSwitches.msg" + "msg/MavlinkLog.msg" + "msg/Mission.msg" + "msg/MissionResult.msg" + "msg/MountOrientation.msg" + "msg/NavigatorMissionItem.msg" + "msg/NpfgStatus.msg" + "msg/ObstacleDistance.msg" + "msg/OffboardControlMode.msg" + "msg/OnboardComputerStatus.msg" + "msg/OpticalFlow.msg" + "msg/OrbitStatus.msg" + "msg/OrbTest.msg" + "msg/OrbTestLarge.msg" + "msg/OrbTestMedium.msg" + "msg/ParameterUpdate.msg" + "msg/Ping.msg" + "msg/PositionControllerLandingStatus.msg" + "msg/PositionControllerStatus.msg" + "msg/PositionSetpoint.msg" + "msg/PositionSetpointTriplet.msg" + "msg/PowerButtonState.msg" + "msg/PowerMonitor.msg" + "msg/PpsCapture.msg" + "msg/PwmInput.msg" + "msg/Px4ioStatus.msg" + "msg/RadioStatus.msg" + "msg/RateCtrlStatus.msg" + "msg/RcChannels.msg" + "msg/RcParameterMap.msg" + "msg/Rpm.msg" + "msg/RtlTimeEstimate.msg" + "msg/Safety.msg" + "msg/SatelliteInfo.msg" + "msg/SensorAccel.msg" + "msg/SensorAccelFifo.msg" + "msg/SensorBaro.msg" + "msg/SensorCombined.msg" + "msg/SensorCorrection.msg" + "msg/SensorGps.msg" + "msg/SensorGyro.msg" + "msg/SensorGyroFft.msg" + "msg/SensorGyroFifo.msg" + "msg/SensorHygrometer.msg" + "msg/SensorMag.msg" + "msg/SensorPreflightMag.msg" + "msg/SensorSelection.msg" + "msg/SensorsStatusImu.msg" + "msg/SystemPower.msg" + "msg/TakeoffStatus.msg" + "msg/TaskStackInfo.msg" + "msg/TecsStatus.msg" + "msg/TelemetryStatus.msg" + "msg/TestMotor.msg" + "msg/Timesync.msg" + "msg/TimesyncStatus.msg" + "msg/TrajectoryBezier.msg" + "msg/TrajectoryWaypoint.msg" + "msg/TransponderReport.msg" + "msg/TuneControl.msg" + "msg/UavcanParameterRequest.msg" + "msg/UavcanParameterValue.msg" + "msg/UlogStream.msg" + "msg/UlogStreamAck.msg" + "msg/VehicleAcceleration.msg" + "msg/VehicleAirData.msg" + "msg/VehicleAngularAcceleration.msg" + "msg/VehicleAngularAccelerationSetpoint.msg" + "msg/VehicleAngularVelocity.msg" + "msg/VehicleAttitude.msg" + "msg/VehicleAttitudeSetpoint.msg" + "msg/VehicleCommand.msg" + "msg/VehicleCommandAck.msg" + "msg/VehicleConstraints.msg" + "msg/VehicleControlMode.msg" + "msg/VehicleGlobalPosition.msg" + "msg/VehicleGpsPosition.msg" + "msg/VehicleImu.msg" + "msg/VehicleImuStatus.msg" + "msg/VehicleLandDetected.msg" + "msg/VehicleLocalPosition.msg" + "msg/VehicleLocalPositionSetpoint.msg" + "msg/VehicleMagnetometer.msg" + "msg/VehicleOdometry.msg" + "msg/VehicleRatesSetpoint.msg" + "msg/VehicleRoi.msg" + "msg/VehicleStatus.msg" + "msg/VehicleStatusFlags.msg" + "msg/VehicleThrustSetpoint.msg" + "msg/VehicleTorqueSetpoint.msg" + "msg/VehicleTrajectoryBezier.msg" + "msg/VehicleTrajectoryWaypoint.msg" + "msg/VtolVehicleStatus.msg" + "msg/WheelEncoders.msg" + "msg/Wind.msg" + "msg/YawEstimatorStatus.msg" +) diff --git a/platforms/ros2/cmake/px4_impl_os.cmake b/platforms/ros2/cmake/px4_impl_os.cmake new file mode 100644 index 0000000000..8580083651 --- /dev/null +++ b/platforms/ros2/cmake/px4_impl_os.cmake @@ -0,0 +1,148 @@ +############################################################################ +# +# Copyright (c) 2021 PX4 Development Team. All rights reserved. +# +# 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. +# +############################################################################ + +#============================================================================= +# +# Defined functions in this file +# +# OS Specific Functions +# +# * px4_posix_generate_builtin_commands +# +# Required OS Interface Functions +# +# * px4_os_add_flags +# * px4_os_determine_build_chip +# * px4_os_prebuild_targets +# + +#============================================================================= +# +# px4_posix_generate_builtin_commands +# +# This function generates the builtin_commands.c src for posix +# +# Usage: +# px4_posix_generate_builtin_commands( +# MODULE_LIST +# OUT ) +# +# Input: +# MODULE_LIST : list of modules +# +# Output: +# OUT : stem of generated apps.cpp/apps.h ("apps") +# +# Example: +# px4_posix_generate_builtin_commands( +# OUT MODULE_LIST px4_simple_app) +# +function(px4_posix_generate_builtin_commands) + px4_parse_function_args( + NAME px4_posix_generate_builtin_commands + ONE_VALUE OUT + MULTI_VALUE MODULE_LIST + REQUIRED MODULE_LIST OUT + ARGN ${ARGN}) + +endfunction() + +#============================================================================= +# +# px4_os_add_flags +# +# Set the posix build flags. +# +# Usage: +# px4_os_add_flags() +# +function(px4_os_add_flags) + + add_definitions( + -D__PX4_ROS2 + -D__PX4_POSIX + -Dnoreturn_function=__attribute__\(\(noreturn\)\) + ) + + include_directories(platforms/ros2/include) + +endfunction() + +#============================================================================= +# +# px4_os_determine_build_chip +# +# Sets PX4_CHIP and PX4_CHIP_MANUFACTURER. +# +# Usage: +# px4_os_determine_build_chip() +# +function(px4_os_determine_build_chip) + + # always use generic chip and chip manufacturer + set(PX4_CHIP "generic" CACHE STRING "PX4 Chip" FORCE) + set(PX4_CHIP_MANUFACTURER "generic" CACHE STRING "PX4 Chip Manufacturer" FORCE) + +endfunction() + +#============================================================================= +# +# px4_os_prebuild_targets +# +# This function generates os dependent targets +# +# Usage: +# px4_os_prebuild_targets( +# OUT +# BOARD +# ) +# +# Input: +# BOARD : board +# +# Output: +# OUT : the target list +# +# Example: +# px4_os_prebuild_targets(OUT target_list BOARD px4_fmu-v2) +# +function(px4_os_prebuild_targets) + px4_parse_function_args( + NAME px4_os_prebuild_targets + ONE_VALUE OUT BOARD + REQUIRED OUT + ARGN ${ARGN}) + + add_library(prebuild_targets INTERFACE) + +endfunction() diff --git a/src/lib/systemlib/conversions.h b/platforms/ros2/include/hrt_work.h similarity index 68% rename from src/lib/systemlib/conversions.h rename to platforms/ros2/include/hrt_work.h index dc383e770f..2394ec0957 100644 --- a/src/lib/systemlib/conversions.h +++ b/platforms/ros2/include/hrt_work.h @@ -1,7 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. - * Author: Lorenz Meier + * Copyright (C) 2015 Mark Charlebois. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,30 +31,34 @@ * ****************************************************************************/ -/** - * @file conversions.h - * Definition of commonly used conversions. - * - * Includes bit / byte / geo representation and unit conversions. - */ +#pragma once -#ifndef CONVERSIONS_H_ -#define CONVERSIONS_H_ -#include -#include +#include +#include +#include + +#include __BEGIN_DECLS -/** - * Converts a signed 16 bit integer from big endian to little endian. - * - * This function is for commonly used 16 bit big endian sensor data, - * delivered by driver routines as two 8 bit numbers in big endian order. - * Common vendors with big endian representation are Invense, Bosch and - * Honeywell. ST micro devices tend to use a little endian representation. - */ -__EXPORT int16_t int16_t_from_bytes(uint8_t bytes[]); +extern px4_sem_t _hrt_work_lock; +extern struct wqueue_s g_hrt_work; + +void hrt_work_queue_init(void); +int hrt_work_queue(struct work_s *work, worker_t worker, void *arg, uint32_t usdelay); +void hrt_work_cancel(struct work_s *work); + +static inline void hrt_work_lock(void); +static inline void hrt_work_lock() +{ + px4_sem_wait(&_hrt_work_lock); +} + +static inline void hrt_work_unlock(void); +static inline void hrt_work_unlock() +{ + px4_sem_post(&_hrt_work_lock); +} __END_DECLS -#endif /* CONVERSIONS_H_ */ diff --git a/platforms/ros2/include/px4_platform_common/Node.hpp b/platforms/ros2/include/px4_platform_common/Node.hpp new file mode 100644 index 0000000000..496600badd --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/Node.hpp @@ -0,0 +1,42 @@ + +#pragma once + +#include "rclcpp/rclcpp.hpp" + +namespace px4 +{ + +class Node : public rclcpp::Node +{ +public: + explicit Node(const char *node_name) : + rclcpp::Node(node_name) + { + + } + + + ~Node() override = default; + +private: + +}; + +}; + + +// int main(int argc, char *argv[]) +// { +// rclcpp::init(argc, argv); +// rclcpp::spin(std::make_shared()); +// rclcpp::shutdown(); +// return 0; +// } + + +// #include "rclcpp_components/register_node_macro.hpp" + +// // Register the component with class_loader. +// // This acts as a sort of entry point, allowing the component to be discoverable when its library +// // is being loaded into a running process. +// RCLCPP_COMPONENTS_REGISTER_NODE(composition::Client) diff --git a/platforms/ros2/include/px4_platform_common/defines.h b/platforms/ros2/include/px4_platform_common/defines.h new file mode 100644 index 0000000000..5667e5ef9d --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/defines.h @@ -0,0 +1,53 @@ +/**************************************************************************** + * + * Copyright (c) 2014 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file defines.h + * + * Generally used magic defines + */ + +#pragma once + +/**************************************************************************** + * Defines for all platforms. + ****************************************************************************/ + +#define PX4_ERROR (-1) +#define PX4_OK 0 + +/* Define PX4_ISFINITE */ +#ifdef __cplusplus +constexpr bool PX4_ISFINITE(float x) { return __builtin_isfinite(x); } +constexpr bool PX4_ISFINITE(double x) { return __builtin_isfinite(x); } +#endif /* __cplusplus */ diff --git a/platforms/ros2/include/px4_platform_common/log.h b/platforms/ros2/include/px4_platform_common/log.h new file mode 100644 index 0000000000..f9cb4820d5 --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/log.h @@ -0,0 +1,41 @@ +/**************************************************************************** + * + * Copyright (C) 2021 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +#pragma once + +//#include + +#define PX4_INFO(X) printf(X) //RCLCPP_INFO(get_logger(), X) +#define PX4_WARN(X) printf(X) //RCLCPP_WARN(get_logger(), X) +#define PX4_ERR(X) printf(X) //RCLCPP_ERR(get_logger(), X) +#define PX4_DEBUG(...) printf(X) //RCLCPP_DEBUG(get_logger(), __VA_ARGS__) diff --git a/platforms/ros2/include/px4_platform_common/module.h b/platforms/ros2/include/px4_platform_common/module.h new file mode 100644 index 0000000000..436c86ed92 --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/module.h @@ -0,0 +1,417 @@ +/**************************************************************************** + * + * Copyright (c) 2021 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file px4_module.h + */ + +#pragma once + +#ifdef __cplusplus + +#include + +#include "rclcpp/rclcpp.hpp" + +/** + * @class ModuleBase + * Base class for modules, implementing common functionality, + * such as 'start', 'stop' and 'status' commands. + * Currently does not support modules which allow multiple instances, + * such as mavlink. + * + * The class is implemented as curiously recurring template pattern (CRTP). + * It allows to have a static object in the base class that is different for + * each module type, and call static methods from the base class. + * + * @note Required methods for a derived class: + * When running in its own thread: + * static int task_spawn(int argc, char *argv[]) + * { + * // call px4_task_spawn_cmd() with &run_trampoline as startup method + * // optional: wait until _object is not null, which means the task got initialized (use a timeout) + * // set _task_id and return 0 + * // on error return != 0 (and _task_id must be -1) + * } + * + * static T *instantiate(int argc, char *argv[]) + * { + * // this is called from within the new thread, from run_trampoline() + * // parse the arguments + * // create a new object T & return it + * // or return nullptr on error + * } + * + * static int custom_command(int argc, char *argv[]) + * { + * // support for custom commands + * // it none are supported, just do: + * return print_usage("unrecognized command"); + * } + * + * static int print_usage(const char *reason = nullptr) + * { + * // use the PRINT_MODULE_* methods... + * } + * + * When running on the work queue: + * - custom_command & print_usage as above + * static int task_spawn(int argc, char *argv[]) { + * // parse the arguments + * // set _object (here or from the work_queue() callback) + * // call work_queue() (with a custom cycle trampoline) + * // optional: wait until _object is not null, which means the task got initialized (use a timeout) + * // set _task_id to task_id_is_work_queue and return 0 + * // on error return != 0 (and _task_id must be -1) + * } + */ +template +class ModuleBase : public rclcpp::Node +{ +public: + ModuleBase() : Node(MODULE_NAME) + { + + RCLCPP_INFO(get_logger(), "constructing %lu", hrt_absolute_time()); + } + + virtual ~ModuleBase() {} + + /** + * @brief main Main entry point to the module that should be + * called directly from the module's main method. + * @param argc The task argument count. + * @param argc Pointer to the task argument variable array. + * @return Returns 0 iff successful, -1 otherwise. + */ + static int main(int argc, char *argv[]) + { + + + return ret; + } + + /** + * @brief Print the status if the module is running. This can be overridden by the module to provide + * more specific information. + * @return Returns 0 iff successful, -1 otherwise. + */ + virtual int print_status() + { + PX4_INFO("running"); + return 0; + } + + /** + * @brief Main loop method for modules running in their own thread. Called from run_trampoline(). + * This method must return when should_exit() returns true. + */ + virtual void run() + { + } + + /** + * @brief Returns the status of the module. + * @return Returns true if the module is running, false otherwise. + */ + static bool is_running() + { + return _task_id != -1; + } + +protected: + + /** + * @brief Tells the module to stop (used from outside or inside the module thread). + */ + virtual void request_stop() + { + _task_should_exit.store(true); + } + + /** + * @brief Checks if the module should stop (used within the module thread). + * @return Returns True iff successful, false otherwise. + */ + bool should_exit() const + { + return _task_should_exit.load(); + } + + /** + * @brief Exits the module and delete the object. Called from within the module's thread. + * For work queue modules, this needs to be called from the derived class in the + * cycle method, when should_exit() returns true. + */ + static void exit_and_cleanup() + { + // Take the lock here: + // - if startup fails and we're faster than the parent thread, it will set + // _task_id and subsequently it will look like the task is running. + // - deleting the object must take place inside the lock. + lock_module(); + + delete _object.load(); + _object.store(nullptr); + + _task_id = -1; // Signal a potentially waiting thread for the module to exit that it can continue. + unlock_module(); + } + + /** + * @brief Waits until _object is initialized, (from the new thread). This can be called from task_spawn(). + * @return Returns 0 iff successful, -1 on timeout or otherwise. + */ + static int wait_until_running(int timeout_ms = 1000) + { + int i = 0; + + do { + px4_usleep(2000); + + } while (!_object.load() && ++i < timeout_ms / 2); + + if (i >= timeout_ms / 2) { + PX4_ERR("Timed out while waiting for thread to start"); + return -1; + } + + return 0; + } + + /** + * @brief Get the module's object instance, (this is null if it's not running). + */ + static T *get_instance() + { + return (T *)_object.load(); + } + + /** + * @var _object Instance if the module is running. + * @note There will be one instance for each template type. + */ + static px4::atomic _object; + + /** @var _task_id The task handle: -1 = invalid, otherwise task is assumed to be running. */ + static int _task_id; + + /** @var task_id_is_work_queue Value to indicate if the task runs on the work queue. */ + static constexpr const int task_id_is_work_queue = -2; + +private: + /** + * @brief lock_module Mutex to lock the module thread. + */ + static void lock_module() + { + pthread_mutex_lock(&px4_modules_mutex); + } + + /** + * @brief unlock_module Mutex to unlock the module thread. + */ + static void unlock_module() + { + pthread_mutex_unlock(&px4_modules_mutex); + } + + /** @var _task_should_exit Boolean flag to indicate if the task should exit. */ + px4::atomic_bool _task_should_exit{false}; +}; + +template +px4::atomic ModuleBase::_object{nullptr}; + +template +int ModuleBase::_task_id = -1; + + +#endif /* __cplusplus */ + + +__BEGIN_DECLS + +/** + * @brief Module documentation and command usage help methods. + * These are extracted with the Tools/px_process_module_doc.py + * script and must be kept in sync. + */ + +#ifdef __PX4_NUTTX +/** + * @note Disable module description on NuttX to reduce Flash usage. + * There's a GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55971), preventing us to use + * a macro, but GCC will remove the string as well with this empty inline method. + * @param description The provided functionality of the module and potentially the most important parameters. + */ +static inline void PRINT_MODULE_DESCRIPTION(const char *description) {} +#else + +/** + * @brief Prints module documentation (will also be used for online documentation). It uses Markdown syntax + * and should include these sections: + * - ### Description + * Provided functionality of the module and potentially the most important parameters. + * - ### Implementation + * High-level implementation overview + * - ### Examples + * Examples how to use the CLI interface (if it's non-trivial) + * + * In addition to the Markdown syntax, a line beginning with '$ ' can be used to mark a command: + * $ module start -p param + */ +__EXPORT void PRINT_MODULE_DESCRIPTION(const char *description); +#endif + +/** + * @brief Prints the command name. + * @param executable_name: command name used in scripts & CLI + * @param category one of: driver, estimator, controller, system, communication, command, template + */ +__EXPORT void PRINT_MODULE_USAGE_NAME(const char *executable_name, const char *category); + +/** + * @brief Specify a subcategory (optional). + * @param subcategory e.g. if the category is 'driver', subcategory can be 'distance_sensor' + */ +__EXPORT void PRINT_MODULE_USAGE_SUBCATEGORY(const char *subcategory); + +/** + * @brief Prints the name for a command without any sub-commands (@see PRINT_MODULE_USAGE_NAME()). + */ +__EXPORT void PRINT_MODULE_USAGE_NAME_SIMPLE(const char *executable_name, const char *category); + + +/** + * @brief Prints a command with a short description what it does. + */ +__EXPORT void PRINT_MODULE_USAGE_COMMAND_DESCR(const char *name, const char *description); + +#define PRINT_MODULE_USAGE_COMMAND(name) \ + PRINT_MODULE_USAGE_COMMAND_DESCR(name, NULL); + +/** + * @brief Prints the default commands: stop & status. + */ +#define PRINT_MODULE_USAGE_DEFAULT_COMMANDS() \ + PRINT_MODULE_USAGE_COMMAND("stop"); \ + PRINT_MODULE_USAGE_COMMAND_DESCR("status", "print status info"); + +/** + * Print default params for I2C or SPI drivers + * @param i2c_support true if the driver supports I2C + * @param spi_support true if the driver supports SPI + */ +__EXPORT void PRINT_MODULE_USAGE_PARAMS_I2C_SPI_DRIVER(bool i2c_support, bool spi_support); + +/** + * Configurable I2C address (via -a
) + */ +__EXPORT void PRINT_MODULE_USAGE_PARAMS_I2C_ADDRESS(uint8_t default_address); + +/** + * -k flag + */ +__EXPORT void PRINT_MODULE_USAGE_PARAMS_I2C_KEEP_RUNNING_FLAG(void); + +/** @note Each of the PRINT_MODULE_USAGE_PARAM_* methods apply to the previous PRINT_MODULE_USAGE_COMMAND_DESCR(). */ + +/** + * @brief Prints an integer parameter. + * @param option_char The option character. + * @param default_val The parameter default value (set to -1 if not applicable). + * @param min_val The parameter minimum value. + * @param max_val The parameter value. + * @param description Pointer to the usage description. + * @param is_optional true if this parameter is optional + */ +__EXPORT void PRINT_MODULE_USAGE_PARAM_INT(char option_char, int default_val, int min_val, int max_val, + const char *description, bool is_optional); + +/** + * @brief Prints a float parameter. + * @note See PRINT_MODULE_USAGE_PARAM_INT(). + * @param default_val The parameter default value (set to NaN if not applicable). + * @param min_val The parameter minimum value. + * @param max_val The parameter maximum value. + * @param description Pointer to the usage description. Pointer to the usage description. + * @param is_optional true if this parameter is optional + */ +__EXPORT void PRINT_MODULE_USAGE_PARAM_FLOAT(char option_char, float default_val, float min_val, float max_val, + const char *description, bool is_optional); + +/** + * @brief Prints a flag parameter, without any value. + * @note See PRINT_MODULE_USAGE_PARAM_INT(). + * @param option_char The option character. + * @param description Pointer to the usage description. + * @param is_optional true if this parameter is optional + */ +__EXPORT void PRINT_MODULE_USAGE_PARAM_FLAG(char option_char, const char *description, bool is_optional); + +/** + * @brief Prints a string parameter. + * @param option_char The option character. + * @param default_val The default value, can be nullptr. + * @param values The valid values, it has one of the following forms: + * - nullptr: leave unspecified, or any value is valid + * - "" or "": a file or more specifically a device file (eg. serial device) + * - "": uORB topic name + * - " []": a list of values + * - "on|off": a concrete set of valid strings separated by "|". + * @param description Pointer to the usage description. + * @param is_optional True iff this parameter is optional. + */ +__EXPORT void PRINT_MODULE_USAGE_PARAM_STRING(char option_char, const char *default_val, const char *values, + const char *description, bool is_optional); + +/** + * @brief Prints a comment, that applies to the next arguments or parameters. For example to indicate that + * a parameter applies to several or all commands. + * @param comment + */ +__EXPORT void PRINT_MODULE_USAGE_PARAM_COMMENT(const char *comment); + + +/** + * @brief Prints the definition for an argument, which does not have the typical -p form, + * but for example 'param set ' + * @param values eg. "", " " or " []" + * @param description Pointer to the usage description. + * @param is_optional true if this parameter is optional + */ +__EXPORT void PRINT_MODULE_USAGE_ARG(const char *values, const char *description, bool is_optional); + + +__END_DECLS diff --git a/platforms/ros2/include/px4_platform_common/module_params.h b/platforms/ros2/include/px4_platform_common/module_params.h new file mode 100644 index 0000000000..d2e518f0ce --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/module_params.h @@ -0,0 +1,96 @@ +/**************************************************************************** + * + * Copyright (c) 2018 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file px4_module_params.h + * + * @class ModuleParams is a C++ base class for modules/classes using configuration parameters. + */ + +#pragma once + +#include + +#include "param.h" + +class ModuleParams : public ListNode +{ +public: + + ModuleParams(ModuleParams *parent) + { + setParent(parent); + } + + /** + * @brief Sets the parent module. This is typically not required, + * only in cases where the parent cannot be set via constructor. + */ + void setParent(ModuleParams *parent) + { + if (parent) { + parent->_children.add(this); + } + } + + virtual ~ModuleParams() = default; + + // Disallow copy construction and move assignment. + ModuleParams(const ModuleParams &) = delete; + ModuleParams &operator=(const ModuleParams &) = delete; + ModuleParams(ModuleParams &&) = delete; + ModuleParams &operator=(ModuleParams &&) = delete; + +protected: + /** + * @brief Call this method whenever the module gets a parameter change notification. + * It will automatically call updateParams() for all children, which then call updateParamsImpl(). + */ + virtual void updateParams() + { + for (const auto &child : _children) { + child->updateParams(); + } + + updateParamsImpl(); + } + + /** + * @brief The implementation for this is generated with the macro DEFINE_PARAMETERS() + */ + virtual void updateParamsImpl() {} + +private: + /** @list _children The module parameter list of inheriting classes. */ + List _children; +}; diff --git a/platforms/ros2/include/px4_platform_common/param.h b/platforms/ros2/include/px4_platform_common/param.h new file mode 100644 index 0000000000..3a2aa80aac --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/param.h @@ -0,0 +1,452 @@ +/**************************************************************************** + * + * Copyright (c) 2018 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file param.h + * + * C++ Parameter class + */ + +#pragma once + +#include "param_macros.h" +#include +#include + +#include + +#define _DEFINE_SINGLE_PARAMETER(x) \ + do_not_explicitly_use_this_namespace::PAIR(x); + +#define _CALL_UPDATE(x) \ + STRIP(x).update(); + +// define the parameter update method, which will update all parameters. +// It is marked as 'final', so that wrong usages lead to a compile error (see below) +#define _DEFINE_PARAMETER_UPDATE_METHOD(...) \ + protected: \ + void updateParamsImpl() final { \ + APPLY_ALL(_CALL_UPDATE, __VA_ARGS__) \ + } \ + private: + +// Define a list of parameters. This macro also creates code to update parameters. +// If you get a compile error like: +// error: virtual function ‘virtual void ::updateParamsImpl()’ +// It means you have a custom inheritance tree (at least one class with params that inherits from another +// class with params) and you need to use DEFINE_PARAMETERS_CUSTOM_PARENT() for **all** classes in +// that tree. +#define DEFINE_PARAMETERS(...) \ + APPLY_ALL(_DEFINE_SINGLE_PARAMETER, __VA_ARGS__) \ + _DEFINE_PARAMETER_UPDATE_METHOD(__VA_ARGS__) + + +#define _DEFINE_PARAMETER_UPDATE_METHOD_CUSTOM_PARENT(parent_class, ...) \ + protected: \ + void updateParamsImpl() override { \ + parent_class::updateParamsImpl(); \ + APPLY_ALL(_CALL_UPDATE, __VA_ARGS__) \ + } \ + private: + +#define DEFINE_PARAMETERS_CUSTOM_PARENT(parent_class, ...) \ + APPLY_ALL(_DEFINE_SINGLE_PARAMETER, __VA_ARGS__) \ + _DEFINE_PARAMETER_UPDATE_METHOD_CUSTOM_PARENT(parent_class, __VA_ARGS__) + + + +// This namespace never needs to be used directly. Use the DEFINE_PARAMETERS_CUSTOM_PARENT and +// DEFINE_PARAMETERS macros instead (the Param classes don't depend on using the macro, the macro just +// makes sure that update() is automatically called). +namespace do_not_explicitly_use_this_namespace +{ + +template +class Param +{ +}; + +// We use partial template specialization for each param type. This is only supported for classes, not individual methods, +// which is why we have to repeat the whole class +template +class Param +{ +public: + // static type-check + static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_FLOAT, "parameter type must be float"); + + Param() + { + //param_set_used(handle()); + update(); + } + + float get() const { return _val; } + + const float &reference() const { return _val; } + + /// Store the parameter value to the parameter storage (@see param_set()) + bool commit() const + { + return true; // TODO + //return param_set(handle(), &_val) == 0; + } + + /// Store the parameter value to the parameter storage, w/o notifying the system (@see param_set_no_notification()) + bool commit_no_notification() const + { + return true; // TODO + //return param_set_no_notification(handle(), &_val) == 0; + } + + /// Set and commit a new value. Returns true if the value changed. + bool commit_no_notification(float val) + { + if (fabsf(val - _val) > FLT_EPSILON) { + set(val); + commit_no_notification(); + return true; + } + + return false; + } + + void set(float val) { _val = val; } + + void reset() + { + //param_reset_no_notification(handle()); // TODO + update(); + } + + bool update() + { + return true; // TODO + //return param_get(handle(), &_val) == 0; + } + + //param_t handle() const { return param_handle(p); } +private: + float _val; +}; + +// external version +template +class Param +{ +public: + // static type-check + static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_FLOAT, "parameter type must be float"); + + Param(float &external_val) + : _val(external_val) + { + //param_set_used(handle()); // TODO + update(); + } + + float get() const { return _val; } + + const float &reference() const { return _val; } + + /// Store the parameter value to the parameter storage (@see param_set()) + bool commit() const + { + //return param_set(handle(), &_val) == 0; // TODO + return true; + } + + /// Store the parameter value to the parameter storage, w/o notifying the system (@see param_set_no_notification()) + bool commit_no_notification() const + { + return true; + //return param_set_no_notification(handle(), &_val) == 0; + } + + /// Set and commit a new value. Returns true if the value changed. + bool commit_no_notification(float val) + { + if (fabsf(val - _val) > FLT_EPSILON) { + set(val); + commit_no_notification(); + return true; + } + + return false; + } + + void set(float val) { _val = val; } + + void reset() + { + //param_reset_no_notification(handle()); + update(); + } + + bool update() + { + return true; + //return param_get(handle(), &_val) == 0; + } + + //param_t handle() const { return param_handle(p); } +private: + float &_val; +}; + +template +class Param +{ +public: + // static type-check + static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_INT32, "parameter type must be int32_t"); + + Param() + { + //param_set_used(handle()); + update(); + } + + int32_t get() const { return _val; } + + const int32_t &reference() const { return _val; } + + /// Store the parameter value to the parameter storage (@see param_set()) + bool commit() const + { + return true; + //return param_set(handle(), &_val) == 0; + } + + /// Store the parameter value to the parameter storage, w/o notifying the system (@see param_set_no_notification()) + bool commit_no_notification() const + { + //return param_set_no_notification(handle(), &_val) == 0; + return true; + } + + /// Set and commit a new value. Returns true if the value changed. + bool commit_no_notification(int32_t val) + { + if (val != _val) { + set(val); + commit_no_notification(); + return true; + } + + return false; + } + + void set(int32_t val) { _val = val; } + + void reset() + { + //param_reset_no_notification(handle()); + update(); + } + + bool update() + { + //return param_get(handle(), &_val) == 0; + return true; + } + + //param_t handle() const { return param_handle(p); } +private: + int32_t _val; +}; + +//external version +template +class Param +{ +public: + // static type-check + static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_INT32, "parameter type must be int32_t"); + + Param(int32_t &external_val) + : _val(external_val) + { + //param_set_used(handle()); + update(); + } + + int32_t get() const { return _val; } + + const int32_t &reference() const { return _val; } + + /// Store the parameter value to the parameter storage (@see param_set()) + bool commit() const + { + return true; + //return param_set(handle(), &_val) == 0; + } + + /// Store the parameter value to the parameter storage, w/o notifying the system (@see param_set_no_notification()) + bool commit_no_notification() const + { + return true; + //return param_set_no_notification(handle(), &_val) == 0; + } + + /// Set and commit a new value. Returns true if the value changed. + bool commit_no_notification(int32_t val) + { + if (val != _val) { + set(val); + commit_no_notification(); + return true; + } + + return false; + } + + void set(int32_t val) { _val = val; } + + void reset() + { + //param_reset_no_notification(handle()); + update(); + } + + bool update() + { + //return param_get(handle(), &_val) == 0; + return true; + } + + //param_t handle() const { return param_handle(p); } +private: + int32_t &_val; +}; + +template +class Param +{ +public: + // static type-check + static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_INT32, "parameter type must be int32_t"); + + Param() + { + //param_set_used(handle()); + update(); + } + + bool get() const { return _val; } + + const bool &reference() const { return _val; } + + /// Store the parameter value to the parameter storage (@see param_set()) + bool commit() const + { + int32_t value_int = (int32_t)_val; + //return param_set(handle(), &value_int) == 0; + return true; + } + + /// Store the parameter value to the parameter storage, w/o notifying the system (@see param_set_no_notification()) + bool commit_no_notification() const + { + int32_t value_int = (int32_t)_val; + //return param_set_no_notification(handle(), &value_int) == 0; + return true; + } + + /// Set and commit a new value. Returns true if the value changed. + bool commit_no_notification(bool val) + { + if (val != _val) { + set(val); + commit_no_notification(); + return true; + } + + return false; + } + + void set(bool val) { _val = val; } + + void reset() + { + //param_reset_no_notification(handle()); + update(); + } + + bool update() + { + int32_t value_int; + int ret = 0;//param_get(handle(), &value_int); + + if (ret == 0) { + _val = value_int != 0; + return true; + } + + return false; + } + + //param_t handle() const { return param_handle(p); } +private: + bool _val; +}; + +template +using ParamFloat = Param; + +template +using ParamInt = Param; + +template +using ParamExtFloat = Param; + +template +using ParamExtInt = Param; + +template +using ParamBool = Param; + +} /* namespace do_not_explicitly_use_this_namespace */ + + +// Raise an appropriate compile error if a Param class is used directly (just to simplify debugging) +template +class ParamInt +{ + static_assert((int)p &&false, "Do not use this class directly, use the DEFINE_PARAMETERS macro instead"); +}; +template +class ParamFloat +{ + static_assert((int)p &&false, "Do not use this class directly, use the DEFINE_PARAMETERS macro instead"); +}; diff --git a/platforms/ros2/include/px4_platform_common/param_macros.h b/platforms/ros2/include/px4_platform_common/param_macros.h new file mode 100644 index 0000000000..6b27b81a23 --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/param_macros.h @@ -0,0 +1,250 @@ +/**************************************************************************** + * + * Copyright (c) 2018 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file param_macros.h + * + * Helper macros used by px4_param.h + */ + +#pragma once + + +#define APPLY0(t) +#define APPLY1(t, aaa) t(aaa) +#define APPLY2(t, aaa, aab) t(aaa) t(aab) +#define APPLY3(t, aaa, aab, aac) t(aaa) t(aab) t(aac) +#define APPLY4(t, aaa, aab, aac, aad) t(aaa) t(aab) t(aac) t(aad) +#define APPLY5(t, aaa, aab, aac, aad, aae) t(aaa) t(aab) t(aac) t(aad) t(aae) +#define APPLY6(t, aaa, aab, aac, aad, aae, aaf) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) +#define APPLY7(t, aaa, aab, aac, aad, aae, aaf, aag) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) +#define APPLY8(t, aaa, aab, aac, aad, aae, aaf, aag, aah) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) +#define APPLY9(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) +#define APPLY10(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) +#define APPLY11(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) +#define APPLY12(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) +#define APPLY13(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) +#define APPLY14(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) +#define APPLY15(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) +#define APPLY16(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) +#define APPLY17(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) +#define APPLY18(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) +#define APPLY19(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) +#define APPLY20(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) +#define APPLY21(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) +#define APPLY22(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) +#define APPLY23(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) +#define APPLY24(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) +#define APPLY25(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) +#define APPLY26(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) +#define APPLY27(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) +#define APPLY28(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) +#define APPLY29(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) +#define APPLY30(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) +#define APPLY31(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) +#define APPLY32(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) +#define APPLY33(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) +#define APPLY34(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) +#define APPLY35(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) +#define APPLY36(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) +#define APPLY37(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) +#define APPLY38(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) +#define APPLY39(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) +#define APPLY40(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) +#define APPLY41(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) +#define APPLY42(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) +#define APPLY43(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) +#define APPLY44(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) +#define APPLY45(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) +#define APPLY46(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) +#define APPLY47(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) +#define APPLY48(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) +#define APPLY49(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) +#define APPLY50(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) +#define APPLY51(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) +#define APPLY52(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) +#define APPLY53(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) +#define APPLY54(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) +#define APPLY55(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) +#define APPLY56(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) +#define APPLY57(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) +#define APPLY58(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) +#define APPLY59(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) +#define APPLY60(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) +#define APPLY61(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) +#define APPLY62(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) +#define APPLY63(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) +#define APPLY64(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) +#define APPLY65(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) +#define APPLY66(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) +#define APPLY67(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) +#define APPLY68(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) +#define APPLY69(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) +#define APPLY70(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) +#define APPLY71(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) +#define APPLY72(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) +#define APPLY73(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) +#define APPLY74(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) +#define APPLY75(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) +#define APPLY76(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) +#define APPLY77(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) +#define APPLY78(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) +#define APPLY79(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) +#define APPLY80(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) +#define APPLY81(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) +#define APPLY82(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) +#define APPLY83(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) +#define APPLY84(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) +#define APPLY85(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) +#define APPLY86(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) +#define APPLY87(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) +#define APPLY88(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) +#define APPLY89(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) +#define APPLY90(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) +#define APPLY91(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) +#define APPLY92(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) +#define APPLY93(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) +#define APPLY94(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) +#define APPLY95(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) +#define APPLY96(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) +#define APPLY97(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) +#define APPLY98(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) +#define APPLY99(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) +#define APPLY100(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) +#define APPLY101(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) +#define APPLY102(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) +#define APPLY103(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) +#define APPLY104(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) +#define APPLY105(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) +#define APPLY106(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) +#define APPLY107(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) +#define APPLY108(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) +#define APPLY109(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) +#define APPLY110(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) +#define APPLY111(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) +#define APPLY112(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) +#define APPLY113(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) +#define APPLY114(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) +#define APPLY115(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) +#define APPLY116(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) +#define APPLY117(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) +#define APPLY118(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) +#define APPLY119(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) +#define APPLY120(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) +#define APPLY121(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) +#define APPLY122(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) +#define APPLY123(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) +#define APPLY124(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) +#define APPLY125(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) +#define APPLY126(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) +#define APPLY127(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) +#define APPLY128(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) +#define APPLY129(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) +#define APPLY130(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) +#define APPLY131(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) +#define APPLY132(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) +#define APPLY133(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) +#define APPLY134(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) +#define APPLY135(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) +#define APPLY136(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) +#define APPLY137(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) +#define APPLY138(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) +#define APPLY139(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) +#define APPLY140(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) +#define APPLY141(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj, afk) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) t(afk) +#define APPLY142(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj, afk, afl) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) t(afk) t(afl) +#define APPLY143(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj, afk, afl, afm) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) t(afk) t(afl) t(afm) +#define APPLY144(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj, afk, afl, afm, afn) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) t(afk) t(afl) t(afm) t(afn) +#define APPLY145(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj, afk, afl, afm, afn, afo) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) t(afk) t(afl) t(afm) t(afn) t(afo) +#define APPLY146(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj, afk, afl, afm, afn, afo, afp) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) t(afk) t(afl) t(afm) t(afn) t(afo) t(afp) +#define APPLY147(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj, afk, afl, afm, afn, afo, afp, afq) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) t(afk) t(afl) t(afm) t(afn) t(afo) t(afp) t(afq) +#define APPLY148(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj, afk, afl, afm, afn, afo, afp, afq, afr) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) t(afk) t(afl) t(afm) t(afn) t(afo) t(afp) t(afq) t(afr) +#define APPLY149(t, aaa, aab, aac, aad, aae, aaf, aag, aah, aai, aaj, aak, aal, aam, aan, aao, aap, aaq, aar, aas, aat, aau, aav, aaw, aax, aay, aaz, aba, abb, abc, abd, abe, abf, abg, abh, abi, abj, abk, abl, abm, abn, abo, abp, abq, abr, abs, abt, abu, abv, abw, abx, aby, abz, aca, acb, acc, acd, ace, acf, acg, ach, aci, acj, ack, acl, acm, acn, aco, acp, acq, acr, acs, act, acu, acv, acw, acx, acy, acz, ada, adb, adc, add, ade, adf, adg, adh, adi, adj, adk, adl, adm, adn, ado, adp, adq, adr, ads, adt, adu, adv, adw, adx, ady, adz, aea, aeb, aec, aed, aee, aef, aeg, aeh, aei, aej, aek, ael, aem, aen, aeo, aep, aeq, aer, aes, aet, aeu, aev, aew, aex, aey, aez, afa, afb, afc, afd, afe, aff, afg, afh, afi, afj, afk, afl, afm, afn, afo, afp, afq, afr, afs) t(aaa) t(aab) t(aac) t(aad) t(aae) t(aaf) t(aag) t(aah) t(aai) t(aaj) t(aak) t(aal) t(aam) t(aan) t(aao) t(aap) t(aaq) t(aar) t(aas) t(aat) t(aau) t(aav) t(aaw) t(aax) t(aay) t(aaz) t(aba) t(abb) t(abc) t(abd) t(abe) t(abf) t(abg) t(abh) t(abi) t(abj) t(abk) t(abl) t(abm) t(abn) t(abo) t(abp) t(abq) t(abr) t(abs) t(abt) t(abu) t(abv) t(abw) t(abx) t(aby) t(abz) t(aca) t(acb) t(acc) t(acd) t(ace) t(acf) t(acg) t(ach) t(aci) t(acj) t(ack) t(acl) t(acm) t(acn) t(aco) t(acp) t(acq) t(acr) t(acs) t(act) t(acu) t(acv) t(acw) t(acx) t(acy) t(acz) t(ada) t(adb) t(adc) t(add) t(ade) t(adf) t(adg) t(adh) t(adi) t(adj) t(adk) t(adl) t(adm) t(adn) t(ado) t(adp) t(adq) t(adr) t(ads) t(adt) t(adu) t(adv) t(adw) t(adx) t(ady) t(adz) t(aea) t(aeb) t(aec) t(aed) t(aee) t(aef) t(aeg) t(aeh) t(aei) t(aej) t(aek) t(ael) t(aem) t(aen) t(aeo) t(aep) t(aeq) t(aer) t(aes) t(aet) t(aeu) t(aev) t(aew) t(aex) t(aey) t(aez) t(afa) t(afb) t(afc) t(afd) t(afe) t(aff) t(afg) t(afh) t(afi) t(afj) t(afk) t(afl) t(afm) t(afn) t(afo) t(afp) t(afq) t(afr) t(afs) + +#define NUM_ARGS_H1(dummy, x149, x148, x147, x146, x145, x144, x143, x142, x141, x140, x139, x138, x137, x136, x135, x134, x133, x132, x131, x130, x129, x128, x127, x126, x125, x124, x123, x122, x121, x120, x119, x118, x117, x116, x115, x114, x113, x112, x111, x110, x109, x108, x107, x106, x105, x104, x103, x102, x101, x100, x99, x98, x97, x96, x95, x94, x93, x92, x91, x90, x89, x88, x87, x86, x85, x84, x83, x82, x81, x80, x79, x78, x77, x76, x75, x74, x73, x72, x71, x70, x69, x68, x67, x66, x65, x64, x63, x62, x61, x60, x59, x58, x57, x56, x55, x54, x53, x52, x51, x50, x49, x48, x47, x46, x45, x44, x43, x42, x41, x40, x39, x38, x37, x36, x35, x34, x33, x32, x31, x30, x29, x28, x27, x26, x25, x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, ...) x0 +#define NUM_ARGS(...) NUM_ARGS_H1(dummy, ##__VA_ARGS__, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + +#define APPLY_ALL_H3(t, n, ...) APPLY##n(t, __VA_ARGS__) +#define APPLY_ALL_H2(t, n, ...) APPLY_ALL_H3(t, n, __VA_ARGS__) +#define APPLY_ALL(t, ...) APPLY_ALL_H2(t, NUM_ARGS(__VA_ARGS__), __VA_ARGS__) + +/* + * The above macros are auto-generated using the following python script: +#! /bin/python +# generate a C/C++ macro APPLY_ALL up to 'count' arguments +import sys + +count = 150 + +def output(s): + sys.stdout.write(s) + +def var_name(i): + """ get a variable name in the form abc from a counter i """ + b = ord('a') + return chr(b+((i/26/26) % 26)) + chr(b+((i/26) % 26)) + chr(b+(i % 26)) + +for i in range(count): + output("#define APPLY{:}(t".format(i)) + output(''.join([", {:}".format(var_name(j)) for j in range(i)])) + output(") ") + output(''.join(["t({:}) ".format(var_name(j)) for j in range(i)])) + output("\n") + +output('''\n#define NUM_ARGS_H1(dummy{:}, ...) x0 +'''.format(''.join([', x'+str(x) for x in reversed(range(count))]))) +output('''#define NUM_ARGS(...) NUM_ARGS_H1(dummy, ##__VA_ARGS__{:}) +'''.format(''.join([', '+str(x) for x in reversed(range(count))]))) +output(''' +#define APPLY_ALL_H3(t, n, ...) APPLY##n(t, __VA_ARGS__) +#define APPLY_ALL_H2(t, n, ...) APPLY_ALL_H3(t, n, __VA_ARGS__) +#define APPLY_ALL(t, ...) APPLY_ALL_H2(t, NUM_ARGS(__VA_ARGS__), __VA_ARGS__) +''') + + */ + + +// helper macros to handle macro arguments in the form: (type) name + +#define REM(...) __VA_ARGS__ +#define EAT(...) + +// Retrieve the type +#define TYPEOF(x) DETAIL_TYPEOF(DETAIL_TYPEOF_PROBE x,) +#define DETAIL_TYPEOF(...) DETAIL_TYPEOF_HEAD(__VA_ARGS__) +#define DETAIL_TYPEOF_HEAD(x, ...) REM x +#define DETAIL_TYPEOF_PROBE(...) (__VA_ARGS__), +// Strip off the type, get the name +#define STRIP(x) EAT x +// Show the type without parenthesis +#define PAIR(x) REM x diff --git a/platforms/ros2/include/px4_platform_common/posix.h b/platforms/ros2/include/px4_platform_common/posix.h new file mode 100644 index 0000000000..be991c66d4 --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/posix.h @@ -0,0 +1,40 @@ +/**************************************************************************** + * + * Copyright (c) 2015 Mark Charlebois. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file px4_posix.h + * + * Includes POSIX-like functions for virtual character devices + */ + +#pragma once diff --git a/platforms/ros2/include/px4_platform_common/px4_config.h b/platforms/ros2/include/px4_platform_common/px4_config.h new file mode 100644 index 0000000000..d17f2aff7c --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/px4_config.h @@ -0,0 +1,40 @@ + +/**************************************************************************** + * + * Copyright (C) 2015 Mark Charlebois. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file px4_config.h + Configuration flags used in code. + */ + +#pragma once diff --git a/platforms/ros2/include/px4_platform_common/sem.h b/platforms/ros2/include/px4_platform_common/sem.h new file mode 100644 index 0000000000..6805844e78 --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/sem.h @@ -0,0 +1,108 @@ +/**************************************************************************** + * + * Copyright (c) 2016 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file sem.h + * + * Synchronization primitive: Semaphore + */ + +#pragma once + +#include + +#if !defined(__PX4_NUTTX) +/* Values for protocol attribute */ + +#define SEM_PRIO_NONE 0 +#define SEM_PRIO_INHERIT 1 +#define SEM_PRIO_PROTECT 2 +#define sem_setprotocol(s,p) +#endif + +#if (defined(__PX4_DARWIN) || defined(__PX4_CYGWIN) || defined(__PX4_POSIX) || defined(__PX4_ROS2)) && !defined(__PX4_QURT) + +__BEGIN_DECLS + +typedef struct { + pthread_mutex_t lock; + pthread_cond_t wait; + int value; +} px4_sem_t; + +__EXPORT int px4_sem_init(px4_sem_t *s, int pshared, unsigned value); +__EXPORT int px4_sem_setprotocol(px4_sem_t *s, int protocol); +__EXPORT int px4_sem_wait(px4_sem_t *s); +__EXPORT int px4_sem_trywait(px4_sem_t *sem); +__EXPORT int px4_sem_timedwait(px4_sem_t *sem, const struct timespec *abstime); +__EXPORT int px4_sem_post(px4_sem_t *s); +__EXPORT int px4_sem_getvalue(px4_sem_t *s, int *sval); +__EXPORT int px4_sem_destroy(px4_sem_t *s); + +__END_DECLS + +//#elif defined(__PX4_QURT) + +//typedef sem_t px4_sem_t; + +//#define px4_sem_init sem_init +//#define px4_sem_setprotocol sem_setprotocol +//#define px4_sem_wait sem_wait +//#define px4_sem_trywait sem_trywait +//#define px4_sem_post sem_post +//#define px4_sem_getvalue sem_getvalue +//#define px4_sem_destroy sem_destroy + +#else + +typedef sem_t px4_sem_t; + +__BEGIN_DECLS + +#define px4_sem_init sem_init +#define px4_sem_setprotocol sem_setprotocol +#define px4_sem_wait sem_wait +#define px4_sem_trywait sem_trywait +#define px4_sem_post sem_post +#define px4_sem_getvalue sem_getvalue +#define px4_sem_destroy sem_destroy + +#if defined(__PX4_QURT) +__EXPORT int px4_sem_timedwait(px4_sem_t *sem, const struct timespec *abstime); +#else +#define px4_sem_timedwait sem_timedwait +#endif + +__END_DECLS + +#endif diff --git a/platforms/ros2/include/px4_platform_common/tasks.h b/platforms/ros2/include/px4_platform_common/tasks.h new file mode 100644 index 0000000000..c4d3e9c6c7 --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/tasks.h @@ -0,0 +1,187 @@ +/**************************************************************************** + * + * Copyright (c) 2012-2017 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file px4_tasks.h + * + * @author Lorenz Meier + * @author Mark Charlebois (2015) + * + * Preserve existing task API call signature with OS abstraction + */ + +#pragma once + +#include + +#if defined(__PX4_NUTTX) +typedef int px4_task_t; + +#include +#define px4_prctl prctl + +/** Default scheduler type */ +#if CONFIG_RR_INTERVAL > 0 +# define SCHED_DEFAULT SCHED_RR +#else +# define SCHED_DEFAULT SCHED_FIFO +#endif + +#define px4_task_exit(x) _exit(x) + +#elif defined(__PX4_POSIX) || defined(__PX4_QURT) + +#include +#include + +/** Default scheduler type */ +#define SCHED_DEFAULT SCHED_FIFO + +#if defined(__PX4_LINUX) || defined(__PX4_DARWIN) || defined(__PX4_CYGWIN) || defined(__PX4_ROS2) + +#define SCHED_PRIORITY_MAX sched_get_priority_max(SCHED_FIFO) +#define SCHED_PRIORITY_MIN sched_get_priority_min(SCHED_FIFO) +#define SCHED_PRIORITY_DEFAULT (((sched_get_priority_max(SCHED_FIFO) - sched_get_priority_min(SCHED_FIFO)) / 2) + sched_get_priority_min(SCHED_FIFO)) + +#elif defined(__PX4_QURT) + +#define SCHED_PRIORITY_MAX 255 +#define SCHED_PRIORITY_MIN 0 +#define SCHED_PRIORITY_DEFAULT 20 + +#define SCHED_PRIORITY_MAX sched_get_priority_max(SCHED_FIFO) +#define SCHED_PRIORITY_MIN sched_get_priority_min(SCHED_FIFO) +#define SCHED_PRIORITY_DEFAULT (((sched_get_priority_max(SCHED_FIFO) - sched_get_priority_min(SCHED_FIFO)) / 2) + sched_get_priority_min(SCHED_FIFO)) + +#else +#error "No target OS defined" +#endif + +#if defined (__PX4_LINUX) +#include +#else +#define PR_SET_NAME 1 +#endif + +typedef int px4_task_t; + +typedef struct { + int argc; + char **argv; +} px4_task_args_t; + +#else +#error "No target OS defined" +#endif + +// PX4 work queue starting high priority +#define PX4_WQ_HP_BASE (SCHED_PRIORITY_MAX - 15) + +// Fast drivers - they need to run as quickly as possible to minimize control +// latency. +#define SCHED_PRIORITY_FAST_DRIVER (SCHED_PRIORITY_MAX - 0) + +// Actuator outputs should run as soon as the rate controller publishes +// the actuator controls topic +#define SCHED_PRIORITY_ACTUATOR_OUTPUTS (PX4_WQ_HP_BASE - 3) + +// Attitude controllers typically are in a blocking wait on driver data +// they should be the first to run on an update, using the current sensor +// data and the *previous* attitude reference from the position controller +// which typically runs at a slower rate +#define SCHED_PRIORITY_ATTITUDE_CONTROL (PX4_WQ_HP_BASE - 4) + +// Estimators should run after the attitude controller but before anything +// else in the system. They wait on sensor data which is either coming +// from the sensor hub or from a driver. Keeping this class at a higher +// priority ensures that the estimator runs first if it can, but will +// wait for the sensor hub if its data is coming from it. +#define SCHED_PRIORITY_ESTIMATOR (PX4_WQ_HP_BASE - 5) + +// Position controllers typically are in a blocking wait on estimator data +// so when new sensor data is available they will run last. Keeping them +// on a high priority ensures that they are the first process to be run +// when the estimator updates. +#define SCHED_PRIORITY_POSITION_CONTROL (PX4_WQ_HP_BASE - 7) + +// The log capture (which stores log data into RAM) should run faster +// than other components, but should not run before the control pipeline +#define SCHED_PRIORITY_LOG_CAPTURE (PX4_WQ_HP_BASE - 10) + +// Slow drivers should run at a rate where they do not impact the overall +// system execution +#define SCHED_PRIORITY_SLOW_DRIVER (PX4_WQ_HP_BASE - 35) + +// The navigation system needs to execute regularly but has no realtime needs +#define SCHED_PRIORITY_NAVIGATION (SCHED_PRIORITY_DEFAULT + 5) +// SCHED_PRIORITY_DEFAULT +#define SCHED_PRIORITY_LOG_WRITER (SCHED_PRIORITY_DEFAULT - 10) +#define SCHED_PRIORITY_PARAMS (SCHED_PRIORITY_DEFAULT - 15) +// SCHED_PRIORITY_IDLE + +typedef int (*px4_main_t)(int argc, char *argv[]); + +__BEGIN_DECLS + +/** Starts a task and performs any specific accounting, scheduler setup, etc. */ +__EXPORT px4_task_t px4_task_spawn_cmd(const char *name, + int scheduler, + int priority, + int stack_size, + px4_main_t entry, + char *const argv[]); + +/** Deletes a task - does not do resource cleanup **/ +__EXPORT int px4_task_delete(px4_task_t pid); + +/** Send a signal to a task **/ +__EXPORT int px4_task_kill(px4_task_t pid, int sig); + +/** Exit current task with return value **/ +__EXPORT void px4_task_exit(int ret); + +/** Show a list of running tasks **/ +__EXPORT void px4_show_tasks(void); + +/** See if a task is running **/ +__EXPORT bool px4_task_is_running(const char *taskname); + +#ifdef __PX4_POSIX +/** set process (and thread) options */ +__EXPORT int px4_prctl(int option, const char *arg2, px4_task_t pid); +#endif + +/** return the name of the current task */ +__EXPORT const char *px4_get_taskname(void); + +__END_DECLS diff --git a/platforms/ros2/include/px4_platform_common/time.h b/platforms/ros2/include/px4_platform_common/time.h new file mode 100644 index 0000000000..e55aec5f6e --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/time.h @@ -0,0 +1,6 @@ + + +#define px4_clock_settime system_clock_settime +#define px4_usleep system_usleep +#define px4_sleep system_sleep +#define px4_pthread_cond_timedwait system_pthread_cond_timedwait diff --git a/platforms/ros2/include/px4_platform_common/workqueue.h b/platforms/ros2/include/px4_platform_common/workqueue.h new file mode 100644 index 0000000000..36ab23ed9f --- /dev/null +++ b/platforms/ros2/include/px4_platform_common/workqueue.h @@ -0,0 +1,140 @@ +/**************************************************************************** + * include/nuttx/wqueue.h + * + * Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 NuttX 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. + * + ****************************************************************************/ + +#pragma once + +#if defined(__PX4_NUTTX) +#include +#include +#include +#elif defined(__PX4_POSIX) + +#include +#include + +__BEGIN_DECLS + +#define HPWORK 0 +#define LPWORK 1 +#define NWORKERS 2 + +struct wqueue_s { + pid_t pid; /* The task ID of the worker thread */ + struct dq_queue_s q; /* The queue of pending work */ +}; + +extern struct wqueue_s g_work[NWORKERS]; + +/* Defines the work callback */ + +typedef void (*worker_t)(void *arg); + +struct work_s { + struct dq_entry_s dq; /* Implements a doubly linked list */ + worker_t worker; /* Work callback */ + void *arg; /* Callback argument */ + uint64_t qtime; /* Time work queued */ + uint32_t delay; /* Delay until work performed */ +}; + +/**************************************************************************** + * Name: work_queues_init() + * + * Description: + * Initialize the work queues. + * + ****************************************************************************/ +void work_queues_init(void); + +/**************************************************************************** + * Name: work_queue + * + * Description: + * Queue work to be performed at a later time. All queued work will be + * performed on the worker thread of of execution (not the caller's). + * + * The work structure is allocated by caller, but completely managed by + * the work queue logic. The caller should never modify the contents of + * the work queue structure; the caller should not call work_queue() + * again until either (1) the previous work has been performed and removed + * from the queue, or (2) work_cancel() has been called to cancel the work + * and remove it from the work queue. + * + * Input parameters: + * qid - The work queue ID + * work - The work structure to queue + * worker - The worker callback to be invoked. The callback will invoked + * on the worker thread of execution. + * arg - The argument that will be passed to the workder callback when + * int is invoked. + * delay - Delay (in clock ticks) from the time queue until the worker + * is invoked. Zero means to perform the work immediately. + * + * Returned Value: + * Zero on success, a negated errno on failure + * + ****************************************************************************/ + +int work_queue(int qid, struct work_s *work, worker_t worker, void *arg, uint32_t delay); + +/**************************************************************************** + * Name: work_cancel + * + * Description: + * Cancel previously queued work. This removes work from the work queue. + * After work has been canceled, it may be re-queue by calling work_queue() + * again. + * + * Input parameters: + * qid - The work queue ID + * work - The previously queue work structure to cancel + * + * Returned Value: + * Zero on success, a negated errno on failure + * + ****************************************************************************/ + +int work_cancel(int qid, struct work_s *work); + +uint32_t clock_systimer(void); + +int work_hpthread(int argc, char *argv[]); +int work_lpthread(int argc, char *argv[]); + +__END_DECLS + +#else +#error "Unknown target OS" +#endif diff --git a/platforms/ros2/include/queue.h b/platforms/ros2/include/queue.h new file mode 100644 index 0000000000..d6315ca172 --- /dev/null +++ b/platforms/ros2/include/queue.h @@ -0,0 +1,134 @@ +/************************************************************************ + * include/queue.h + * + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 NuttX 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. + * + ************************************************************************/ + +#ifndef __INCLUDE_QUEUE_H +#define __INCLUDE_QUEUE_H + +/************************************************************************ + * Included Files + ************************************************************************/ + +#include + +#ifdef __cplusplus +#include // NULL +#else +#include // NULL +#endif + +/************************************************************************ + * Pre-processor Definitions + ************************************************************************/ + +#define sq_init(q) do { (q)->head = NULL; (q)->tail = NULL; } while (0) +#define dq_init(q) do { (q)->head = NULL; (q)->tail = NULL; } while (0) + +#define sq_next(p) ((p)->flink) +#define dq_next(p) ((p)->flink) +#define dq_prev(p) ((p)->blink) + +#define sq_empty(q) ((q)->head == NULL) +#define dq_empty(q) ((q)->head == NULL) + +#define sq_peek(q) ((q)->head) +#define dq_peek(q) ((q)->head) + +// Required for Linux +#define FAR + +/************************************************************************ + * Global Type Declarations + ************************************************************************/ + +struct sq_entry_s { + FAR struct sq_entry_s *flink; +}; +typedef struct sq_entry_s sq_entry_t; + +struct dq_entry_s { + FAR struct dq_entry_s *flink; + FAR struct dq_entry_s *blink; +}; +typedef struct dq_entry_s dq_entry_t; + +struct sq_queue_s { + FAR sq_entry_t *head; + FAR sq_entry_t *tail; +}; +typedef struct sq_queue_s sq_queue_t; + +struct dq_queue_s { + FAR dq_entry_t *head; + FAR dq_entry_t *tail; +}; +typedef struct dq_queue_s dq_queue_t; + +/************************************************************************ + * Global Function Prototypes + ************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +EXTERN void sq_addfirst(FAR sq_entry_t *node, sq_queue_t *queue); +EXTERN void dq_addfirst(FAR dq_entry_t *node, dq_queue_t *queue); +EXTERN void sq_addlast(FAR sq_entry_t *node, sq_queue_t *queue); +EXTERN void dq_addlast(FAR dq_entry_t *node, dq_queue_t *queue); +EXTERN void sq_addafter(FAR sq_entry_t *prev, FAR sq_entry_t *node, + sq_queue_t *queue); +EXTERN void dq_addafter(FAR dq_entry_t *prev, FAR dq_entry_t *node, + dq_queue_t *queue); +EXTERN void dq_addbefore(FAR dq_entry_t *next, FAR dq_entry_t *node, + dq_queue_t *queue); + +EXTERN FAR sq_entry_t *sq_remafter(FAR sq_entry_t *node, sq_queue_t *queue); +EXTERN void sq_rem(FAR sq_entry_t *node, sq_queue_t *queue); +EXTERN void dq_rem(FAR dq_entry_t *node, dq_queue_t *queue); +EXTERN FAR sq_entry_t *sq_remlast(sq_queue_t *queue); +EXTERN FAR dq_entry_t *dq_remlast(dq_queue_t *queue); +EXTERN FAR sq_entry_t *sq_remfirst(sq_queue_t *queue); +EXTERN FAR dq_entry_t *dq_remfirst(dq_queue_t *queue); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __INCLUDE_QUEUE_H_ */ + diff --git a/msg/templates/px4/uorb/msg.h.em b/platforms/ros2/include/system_config.h similarity index 55% rename from msg/templates/px4/uorb/msg.h.em rename to platforms/ros2/include/system_config.h index deed11912d..46abd18a03 100644 --- a/msg/templates/px4/uorb/msg.h.em +++ b/platforms/ros2/include/system_config.h @@ -1,23 +1,6 @@ -@############################################### -@# -@# PX4 ROS compatible message source code -@# generation for C++ -@# -@# This file generates the multiplatform wrapper -@# -@# EmPy template for generating .h files -@# Based on the original template for ROS -@# -@############################################### -@# Start of Template -@# -@# Context: -@# - file_name_in (String) Source file -@# - spec (msggen.MsgSpec) Parsed specification of the .msg file -@############################################### /**************************************************************************** * - * Copyright (C) 2013-2015 PX4 Development Team. All rights reserved. + * Copyright (c) 2017 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -48,52 +31,36 @@ * ****************************************************************************/ -/* Auto-generated by genmsg_cpp from file @file_name_in */ - -@{ -import genmsg.msgs - - -native_type = '%s_s'%spec.short_name -topic_name = spec.short_name -}@ +/** + * @file system_config.h + * + * Definitions used by all SITL and Linux targets + */ #pragma once -@############################## -@# Generic Includes -@############################## -#include -#include "platforms/px4_message.h" +#define PX4_CPU_UUID_BYTE_LENGTH 16 +#define PX4_CPU_UUID_WORD32_LENGTH 4 -@############################## -@# Class -@############################## +#define PX4_CPU_MFGUID_BYTE_LENGTH PX4_CPU_UUID_BYTE_LENGTH +#define PX4_CPU_UUID_WORD32_UNIQUE_H 2 /* Most significant digits change the least */ +#define PX4_CPU_UUID_WORD32_UNIQUE_M 1 /* Middle significant digits */ +#define PX4_CPU_UUID_WORD32_UNIQUE_L 0 /* Least significant digits change the most */ +#define PX4_CPU_UUID_WORD32_FORMAT_SIZE (PX4_CPU_UUID_WORD32_LENGTH-1+(2*PX4_CPU_UUID_BYTE_LENGTH)+1) +#define PX4_CPU_MFGUID_FORMAT_SIZE ((2*PX4_CPU_MFGUID_BYTE_LENGTH)+1) -namespace px4 -{ -@[for multi_topic in topics]@ -@{ -cpp_class = 'px4_%s'%multi_topic -}@ +#define BOARD_OVERRIDE_CPU_VERSION (-1) +#define board_mcu_version(rev, revstr, errata) BOARD_OVERRIDE_CPU_VERSION +#define BOARD_HAS_NO_UUID -class __EXPORT @(cpp_class) : - public PX4Message<@(native_type)> -{ -public: - @(cpp_class)() : - PX4Message<@(native_type)>() - {} +#define CONFIG_NFILE_STREAMS 1 +#define CONFIG_SCHED_WORKQUEUE 1 +#define CONFIG_SCHED_HPWORK 1 +#define CONFIG_SCHED_LPWORK 1 - @(cpp_class)(@(native_type) msg) : - PX4Message<@(native_type)>(msg) - {} +/** time in ms between checks for work in work queues **/ +#define CONFIG_SCHED_WORKPERIOD 50000 - ~@(cpp_class)() {} - - static PX4TopicHandle handle() {return ORB_ID(@(multi_topic));} -}; -@[end for] - -}; +#define CONFIG_SCHED_INSTRUMENTATION 1 +#define CONFIG_MAX_TASKS 32 diff --git a/platforms/ros2/include/uORB/Publication.hpp b/platforms/ros2/include/uORB/Publication.hpp new file mode 100644 index 0000000000..3b53424e0b --- /dev/null +++ b/platforms/ros2/include/uORB/Publication.hpp @@ -0,0 +1,148 @@ +/**************************************************************************** + * + * Copyright (c) 2020 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file Publication.hpp + * + */ + +#pragma once + +#include "rclcpp/rclcpp.hpp" + +#include "uORB.h" + +namespace uORB +{ + +template class DefaultQueueSize +{ +private: + template + static constexpr uint8_t get_queue_size(decltype(T::ORB_QUEUE_LENGTH) *) + { + return T::ORB_QUEUE_LENGTH; + } + + template static constexpr uint8_t get_queue_size(...) + { + return 1; + } + +public: + static constexpr unsigned value = get_queue_size(nullptr); +}; + +/** + * uORB publication wrapper class + */ +template::value> +class Publication +{ +public: + + /** + * Constructor + * + * @param meta The uORB metadata (usually from the ORB_ID() macro) for the topic. + */ + Publication(rclcpp::Node *node, ORB_ID id) : _node(*node), _id(id) + { + _publisher = _node.create_publisher(::get_topic_string(_id), ORB_QSIZE); // TODO + } + + bool advertised() { return (_publisher != nullptr); } + + bool advertise() + { + if (!advertised()) { + _publisher = _node.create_publisher(get_topic_string(_id), ORB_QSIZE); + } + + return advertised(); + } + + /** + * Publish the struct + * @param data The uORB message struct we are updating. + */ + bool publish(const T &data) + { + if (!advertised()) { + advertise(); + } + + _publisher->publish(data); + + return true; + } + +private: + typename rclcpp::Publisher::SharedPtr _publisher{nullptr}; + + rclcpp::Node &_node; + + const ORB_ID _id; +}; + +/** + * The publication class with data embedded. + */ +template +class PublicationData : public Publication +{ +public: + /** + * Constructor + * + * @param meta The uORB metadata (usually from the ORB_ID() macro) for the topic. + */ + PublicationData(ORB_ID id) : Publication(id) {} + //PublicationData(const orb_metadata *meta) : Publication(meta) {} + + T &get() { return _data; } + void set(const T &data) { _data = data; } + + // Publishes the embedded struct. + bool update() { return Publication::publish(_data); } + bool update(const T &data) + { + _data = data; + return Publication::publish(_data); + } + +private: + T _data{}; +}; + +} // namespace uORB diff --git a/platforms/ros2/include/uORB/Subscription.hpp b/platforms/ros2/include/uORB/Subscription.hpp new file mode 100644 index 0000000000..f08d145867 --- /dev/null +++ b/platforms/ros2/include/uORB/Subscription.hpp @@ -0,0 +1,167 @@ +/**************************************************************************** + * + * Copyright (c) 2020 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file Subscription.hpp + * + */ + +#pragma once + +#include "rclcpp/rclcpp.hpp" + +#include "uORB.h" + +using std::placeholders::_1; + +namespace uORB +{ + +class SubscriptionCallback; + +template +class Subscription2 +{ +public: + + /** + * Constructor + * + * @param id The uORB ORB_ID enum for the topic. + * @param instance The instance for multi sub. + */ + Subscription2(rclcpp::Node *node, ORB_ID id, uint8_t instance = 0) : + _node(*node), + _id(id) + { + subscribe(); + + (void)instance; // TODO: + } + + ~Subscription2() + { + unsubscribe(); + } + + bool subscribe() + { + if (_subscription == nullptr) { + _subscription = _node.create_subscription(::get_topic_string(_id), 1, std::bind(&Subscription2::topic_callback, + this, _1)); + } + + return (_subscription != nullptr); + } + + void unsubscribe() {} + + bool valid() const { return _subscription != nullptr; } + bool advertised() + { + if (valid()) { + return true; + } + + // try to initialize + if (subscribe()) { + // check again if valid + if (valid()) { + return true; + } + } + + return false; + } + + /** + * Check if there is a new update. + */ + //bool updated() { return advertised() && _node->updates_available(_last_generation); } + bool updated() { return true; } + + /** + * Update the struct + * @param dst The uORB message struct we are updating. + */ + bool update(void *dst) { return updated() && copy(dst); } + + /** + * Copy the struct + * @param dst The uORB message struct we are updating. + */ + bool copy(void *dst) + { + if (advertised()) { + S msg{}; + //_subscription->return_message(&msg); + memcpy(dst, &msg, sizeof(S)); + } + + return false; + } + + /** + * Change subscription instance + * @param instance The new multi-Subscription instance + */ + bool ChangeInstance(uint8_t instance); + + uint8_t get_instance() const { return _instance; } + unsigned get_last_generation() const { return _last_generation; } + orb_id_t get_topic() const { return get_orb_meta(_id); } + +protected: + + typename rclcpp::Subscription::SharedPtr _subscription{nullptr}; + rclcpp::Node &_node; + + unsigned _last_generation{0}; /**< last generation the subscriber has seen */ + + ORB_ID _id{ORB_ID::INVALID}; + uint8_t _instance{0}; + +private: + void topic_callback(const typename S::SharedPtr msg) + { + (void)msg; // TODO + //_msg_buffer = msg; + _topic_generation++; + } + + S _msg_buffer[1]; + + uint32_t _topic_generation{0}; +}; + +} // namespace uORB diff --git a/platforms/ros2/include/uORB/SubscriptionBasic.hpp b/platforms/ros2/include/uORB/SubscriptionBasic.hpp new file mode 100644 index 0000000000..c8f0d7a874 --- /dev/null +++ b/platforms/ros2/include/uORB/SubscriptionBasic.hpp @@ -0,0 +1,155 @@ +/**************************************************************************** + * + * Copyright (c) 2020 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file Subscription.hpp + * + */ + +#pragma once + +#include "rclcpp/rclcpp.hpp" + +#include "rclcpp/subscription_base.hpp" + +#include "uORB.h" + +namespace uORB +{ + +// Base subscription wrapper class +class SubscriptionBasic +{ +public: + + /** + * Constructor + * + * @param id The uORB ORB_ID enum for the topic. + * @param instance The instance for multi sub. + */ + Subscription(rclcpp::Node *node, ORB_ID id, uint8_t instance = 0) : + _node(*node), + _id(id) + { + subscribe(); + + (void)instance; // TODO: + } + + ~Subscription() + { + unsubscribe(); + } + + bool subscribe() + { + if (_subscription == nullptr) { + //_subscription = _node.create_subscription("vehicle_status", 1, std::bind(&Subscription::topic_callback, this, _1)); + } + + return (_subscription != nullptr); + } + + void unsubscribe() {} + + bool valid() const { return _subscription != nullptr; } + bool advertised() + { + if (valid()) { + return true; + } + + // try to initialize + if (subscribe()) { + // check again if valid + if (valid()) { + return true; + } + } + + return false; + } + + /** + * Check if there is a new update. + */ + //bool updated() { return advertised() && _node->updates_available(_last_generation); } + bool updated() { return true; } + + /** + * Update the struct + * @param dst The uORB message struct we are updating. + */ + bool update(void *dst) { return updated() && copy(dst); } + + /** + * Copy the struct + * @param dst The uORB message struct we are updating. + */ + bool copy(void *dst) + { + if (advertised()) { + //_subscription->return_message(&msg); + //memcpy(dst, &msg, sizeof(px4::msg::VehicleStatus)); + } + + return false; + } + + /** + * Change subscription instance + * @param instance The new multi-Subscription instance + */ + bool ChangeInstance(uint8_t instance); + + uint8_t get_instance() const { return _instance; } + unsigned get_last_generation() const { return _last_generation; } + orb_id_t get_topic() const { return get_orb_meta(_id); } + +protected: + + rclcpp::SubscriptionBase::SharedPtr _subscription{nullptr}; + rclcpp::Node &_node; + + unsigned _last_generation{0}; /**< last generation the subscriber has seen */ + + ORB_ID _id{ORB_ID::INVALID}; + uint8_t _instance{0}; + +private: + + uint32_t _topic_generation{0}; +}; + +} // namespace uORB diff --git a/platforms/ros2/include/uORB/uORB.h b/platforms/ros2/include/uORB/uORB.h new file mode 100644 index 0000000000..c329106046 --- /dev/null +++ b/platforms/ros2/include/uORB/uORB.h @@ -0,0 +1,99 @@ +/**************************************************************************** + * + * Copyright (c) 2021 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +#pragma once + + +#include +#include +#include + + +/** + * Object metadata. + */ +struct orb_metadata { + const char *o_name; /**< unique object name */ + const uint16_t o_size; /**< object size */ + const uint16_t o_size_no_padding; /**< object size w/o padding at the end (for logger) */ + const char *o_fields; /**< semicolon separated list of fields (with type) */ + uint8_t o_id; /**< ORB_ID enum */ +}; + +typedef const struct orb_metadata *orb_id_t; + +/** + * Maximum number of multi topic instances. This must be <= 10 (because it's the last char of the node path) + */ +#if defined(CONSTRAINED_MEMORY) +# define ORB_MULTI_MAX_INSTANCES 4 +#else +# define ORB_MULTI_MAX_INSTANCES 10 +#endif + + + +#define ORB_ID(_name) &__orb_##_name + +#if defined(__cplusplus) +# define ORB_DECLARE(_name) extern "C" const struct orb_metadata __orb_##_name __EXPORT +#else +# define ORB_DECLARE(_name) extern const struct orb_metadata __orb_##_name __EXPORT +#endif + + +#define ORB_DEFINE(_name, _struct, _size_no_padding, _fields, _orb_id_enum) \ + const struct orb_metadata __orb_##_name = { \ + #_name, \ + sizeof(_struct), \ + _size_no_padding, \ + _fields, \ + _orb_id_enum \ + }; struct hack + +/** + * Print a topic to console. Do not call this directly, use print_message() instead. + * @param meta orb topic metadata + * @param data expected to be aligned to the largest member + */ +void orb_print_message_internal(const struct orb_metadata *meta, const void *data, bool print_topic_name); + +#ifndef PX4_INFO_RAW +# define PX4_INFO_RAW printf +#endif + +#ifdef __cplusplus + +#include + +#endif // __cplusplus diff --git a/platforms/ros2/src/px4/CMakeLists.txt b/platforms/ros2/src/px4/CMakeLists.txt new file mode 100644 index 0000000000..bf200988a5 --- /dev/null +++ b/platforms/ros2/src/px4/CMakeLists.txt @@ -0,0 +1,37 @@ +############################################################################ +# +# Copyright (c) 2021 PX4 Development Team. All rights reserved. +# +# 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. +# +############################################################################ + +add_subdirectory(common) + +add_subdirectory(${PX4_CHIP_MANUFACTURER}) + diff --git a/platforms/ros2/src/px4/common/CMakeLists.txt b/platforms/ros2/src/px4/common/CMakeLists.txt new file mode 100644 index 0000000000..dc850c246e --- /dev/null +++ b/platforms/ros2/src/px4/common/CMakeLists.txt @@ -0,0 +1,39 @@ +############################################################################ +# +# Copyright (c) 2015 PX4 Development Team. All rights reserved. +# +# 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. +# +############################################################################ + +add_library(px4_layer STATIC + drv_hrt.cpp + px4_sem.cpp +) +target_compile_definitions(px4_layer PRIVATE MODULE_NAME="px4") +target_compile_options(px4_layer PRIVATE -Wno-cast-align) # TODO: fix and enable diff --git a/platforms/ros2/src/px4/common/drv_hrt.cpp b/platforms/ros2/src/px4/common/drv_hrt.cpp new file mode 100644 index 0000000000..55861b6cbc --- /dev/null +++ b/platforms/ros2/src/px4/common/drv_hrt.cpp @@ -0,0 +1,245 @@ +/**************************************************************************** + * + * Copyright (c) 2021 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file drv_hrt.cpp + * + * High-resolution timer with callouts and timekeeping. + */ + +#include + +#include +#include +#include +#include + +#include + +#include +#include + +sq_entry_t *sq_remafter(sq_entry_t *node, sq_queue_t *queue) +{ + sq_entry_t *ret = node->flink; + + if (queue->head && ret) { + if (queue->tail == ret) { + queue->tail = node; + node->flink = NULL; + + } else { + node->flink = ret->flink; + } + + ret->flink = NULL; + } + + return ret; +} + +void sq_rem(sq_entry_t *node, sq_queue_t *queue) +{ + if (queue->head && node) { + if (node == queue->head) { + queue->head = node->flink; + + if (node == queue->tail) { + queue->tail = NULL; + } + + } else { + sq_entry_t *prev; + + for (prev = (sq_entry_t *)queue->head; + prev && prev->flink != node; + prev = prev->flink) {} + + if (prev) { + sq_remafter(prev, queue); + } + } + } +} + + +// Intervals in usec +static constexpr unsigned HRT_INTERVAL_MIN = 50; +static constexpr unsigned HRT_INTERVAL_MAX = 50000000; + +/* + * Queue of callout entries. + */ +sq_entry_t callout_queue{}; + +/* latency baseline (last compare value applied) */ +//static uint64_t latency_baseline; + +/* latency histogram */ +// const uint16_t latency_bucket_count = LATENCY_BUCKET_COUNT; +// const uint16_t latency_buckets[LATENCY_BUCKET_COUNT] = { 1, 2, 5, 10, 20, 50, 100, 1000 }; +// __EXPORT uint32_t latency_counters[LATENCY_BUCKET_COUNT + 1]; + +static px4_sem_t _hrt_lock; +//static struct work_s _hrt_work; + +hrt_abstime hrt_absolute_time_offset() +{ + return 0; +} + +static void hrt_lock() +{ + px4_sem_wait(&_hrt_lock); +} + +static void hrt_unlock() +{ + px4_sem_post(&_hrt_lock); +} + +/* + * Get absolute time. + */ +hrt_abstime hrt_absolute_time() +{ + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return ts_to_abstime(&ts); +} + +/* + * Convert a timespec to absolute time. + */ +hrt_abstime ts_to_abstime(const struct timespec *ts) +{ + return (hrt_abstime)(ts->tv_sec) * 1000000 + ts->tv_nsec / 1000; +} + +/* + * Compute the delta between a timestamp taken in the past + * and now. + * + * This function is safe to use even if the timestamp is updated + * by an interrupt during execution. + */ +hrt_abstime hrt_elapsed_time_atomic(const volatile hrt_abstime *then) +{ + // This is not atomic as the value on the application layer of POSIX is limited. + hrt_abstime delta = hrt_absolute_time() - *then; + return delta; +} + +/* + * Store the absolute time in an interrupt-safe fashion. + * + * This function ensures that the timestamp cannot be seen half-written by an interrupt handler. + */ +void hrt_store_absolute_time(volatile hrt_abstime *t) +{ + *t = hrt_absolute_time(); +} + +/* + * If this returns true, the entry has been invoked and removed from the callout list, + * or it has never been entered. + * + * Always returns false for repeating callouts. + */ +bool hrt_called(struct hrt_call *entry) +{ + return (entry->deadline == 0); +} + +/* + * Remove the entry from the callout list. + */ +void hrt_cancel(struct hrt_call *entry) +{ + hrt_lock(); + //sq_rem(&entry->link, &callout_queue); + entry->deadline = 0; + + /* if this is a periodic call being removed by the callout, prevent it from + * being re-entered when the callout returns. + */ + entry->period = 0; + hrt_unlock(); + // endif +} + +/* + * initialise a hrt_call structure + */ +void hrt_call_init(struct hrt_call *entry) +{ + memset(entry, 0, sizeof(*entry)); +} + +/* + * delay a hrt_call_every() periodic call by the given number of + * microseconds. This should be called from within the callout to + * cause the callout to be re-scheduled for a later time. The periodic + * callouts will then continue from that new base time at the + * previously specified period. + */ +void hrt_call_delay(struct hrt_call *entry, hrt_abstime delay) +{ + entry->deadline = hrt_absolute_time() + delay; +} + +/* + * Initialise the HRT. + */ +void hrt_init() +{ + //sq_init(&callout_queue); + + int sem_ret = px4_sem_init(&_hrt_lock, 0, 1); + + if (sem_ret) { + //PX4_ERR("SEM INIT FAIL: %s", strerror(errno)); + } +} + +void abstime_to_ts(struct timespec *ts, hrt_abstime abstime) +{ + ts->tv_sec = abstime / 1000000; + abstime -= ts->tv_sec * 1000000; + ts->tv_nsec = abstime * 1000; +} + +int px4_clock_gettime(clockid_t clk_id, struct timespec *tp) +{ + return system_clock_gettime(clk_id, tp); +} diff --git a/platforms/ros2/src/px4/common/include/px4_platform/micro_hal.h b/platforms/ros2/src/px4/common/include/px4_platform/micro_hal.h new file mode 100644 index 0000000000..7e48584c1f --- /dev/null +++ b/platforms/ros2/src/px4/common/include/px4_platform/micro_hal.h @@ -0,0 +1,51 @@ +/**************************************************************************** + * + * Copyright (c) 2019 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ +#pragma once + +#include +#include + +typedef int (*xcpt_t)(int irq, void *context, void *arg); + +static inline int px4_arch_configgpio(uint32_t pinset) { return -1; } +static inline int px4_arch_unconfiggpio(uint32_t pinset) { return -1; } +static inline bool px4_arch_gpioread(uint32_t pinset) { return false; } +static inline void px4_arch_gpiowrite(uint32_t pinset, bool value) { } +static inline int px4_arch_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, + bool event, xcpt_t func, void *arg) { return -1; } + +#define px4_udelay(usec) px4_usleep(usec) +#define px4_mdelay(msec) px4_msleep(msec) + +#define px4_cache_aligned_data() +#define px4_cache_aligned_alloc malloc diff --git a/platforms/ros2/src/px4/common/main.cpp b/platforms/ros2/src/px4/common/main.cpp new file mode 100644 index 0000000000..af9af38773 --- /dev/null +++ b/platforms/ros2/src/px4/common/main.cpp @@ -0,0 +1,19 @@ + + + +// PX4 bridge + +// serial/UDP/TCP +// all data in -> publish + + +// data in then publish rclcpp::Publish +// time sync + + + +int main() +{ + + return 0; +} diff --git a/platforms/ros2/src/px4/common/px4_sem.cpp b/platforms/ros2/src/px4/common/px4_sem.cpp new file mode 100644 index 0000000000..77dafadeb9 --- /dev/null +++ b/platforms/ros2/src/px4/common/px4_sem.cpp @@ -0,0 +1,219 @@ +/**************************************************************************** + * + * Copyright (c) 2015 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +/** + * @file px4_sem.cpp + * + * PX4 Middleware Wrapper Linux Implementation + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#if (defined(__PX4_DARWIN) || defined(__PX4_CYGWIN) || defined(__PX4_POSIX)) && !defined(__PX4_QURT) + +#include + +int px4_sem_init(px4_sem_t *s, int pshared, unsigned value) +{ + // We do not used the process shared arg + (void)pshared; + s->value = value; + pthread_cond_init(&(s->wait), nullptr); + pthread_mutex_init(&(s->lock), nullptr); + +#if !defined(__PX4_DARWIN) + // We want to use CLOCK_MONOTONIC if possible but we can't on macOS + // because it's not available. + pthread_condattr_t attr; + pthread_condattr_init(&attr); + pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); + pthread_cond_init(&(s->wait), &attr); +#endif + + return 0; +} + +int px4_sem_setprotocol(px4_sem_t *s, int protocol) +{ + return 0; +} + +int px4_sem_wait(px4_sem_t *s) +{ + int ret = pthread_mutex_lock(&(s->lock)); + + if (ret) { + return ret; + } + + s->value--; + + if (s->value < 0) { + ret = pthread_cond_wait(&(s->wait), &(s->lock)); + + } else { + ret = 0; + } + + if (ret) { + //PX4_WARN("px4_sem_wait failure"); + } + + int mret = pthread_mutex_unlock(&(s->lock)); + + return (ret) ? ret : mret; +} + +int px4_sem_trywait(px4_sem_t *s) +{ + int ret = pthread_mutex_lock(&(s->lock)); + + if (ret) { + return ret; + } + + if (s->value <= 0) { + errno = EAGAIN; + ret = -1; + + } else { + s->value--; + } + + int mret = pthread_mutex_unlock(&(s->lock)); + + return (ret) ? ret : mret; +} + +int px4_sem_timedwait(px4_sem_t *s, const struct timespec *abstime) +{ + int ret = pthread_mutex_lock(&(s->lock)); + + if (ret) { + return ret; + } + + s->value--; + errno = 0; + + if (s->value < 0) { + ret = px4_pthread_cond_timedwait(&(s->wait), &(s->lock), abstime); + + } else { + ret = 0; + } + + errno = ret; + + if (ret != 0 && ret != ETIMEDOUT) { + setbuf(stdout, nullptr); + setbuf(stderr, nullptr); + const unsigned NAMELEN = 32; + char thread_name[NAMELEN] = {}; + (void)pthread_getname_np(pthread_self(), thread_name, NAMELEN); + //PX4_WARN("%s: px4_sem_timedwait failure: ret: %d", thread_name, ret); + } + + int mret = pthread_mutex_unlock(&(s->lock)); + + if (ret || mret) { + return -1; + } + + return 0; +} + +int px4_sem_post(px4_sem_t *s) +{ + int ret = pthread_mutex_lock(&(s->lock)); + + if (ret) { + return ret; + } + + s->value++; + + if (s->value <= 0) { + ret = pthread_cond_signal(&(s->wait)); + + } else { + ret = 0; + } + + if (ret) { + //PX4_WARN("px4_sem_post failure"); + } + + int mret = pthread_mutex_unlock(&(s->lock)); + + // return the cond signal failure if present, + // else return the mutex status + return (ret) ? ret : mret; +} + +int px4_sem_getvalue(px4_sem_t *s, int *sval) +{ + int ret = pthread_mutex_lock(&(s->lock)); + + if (ret) { + //PX4_WARN("px4_sem_getvalue failure"); + } + + if (ret) { + return ret; + } + + *sval = s->value; + ret = pthread_mutex_unlock(&(s->lock)); + + return ret; +} + +int px4_sem_destroy(px4_sem_t *s) +{ + pthread_mutex_lock(&(s->lock)); + pthread_cond_destroy(&(s->wait)); + pthread_mutex_unlock(&(s->lock)); + pthread_mutex_destroy(&(s->lock)); + + return 0; +} + +#endif diff --git a/platforms/ros2/src/px4/generic/CMakeLists.txt b/platforms/ros2/src/px4/generic/CMakeLists.txt new file mode 100644 index 0000000000..72584f3178 --- /dev/null +++ b/platforms/ros2/src/px4/generic/CMakeLists.txt @@ -0,0 +1,34 @@ +############################################################################ +# +# Copyright (c) 2019 PX4 Development Team. All rights reserved. +# +# 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. +# +############################################################################ + +add_subdirectory(${PX4_CHIP}) diff --git a/platforms/ros2/src/px4/generic/generic/CMakeLists.txt b/platforms/ros2/src/px4/generic/generic/CMakeLists.txt new file mode 100644 index 0000000000..18c32a3abd --- /dev/null +++ b/platforms/ros2/src/px4/generic/generic/CMakeLists.txt @@ -0,0 +1,32 @@ +############################################################################ +# +# Copyright (c) 2021 PX4 Development Team. All rights reserved. +# +# 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. +# +############################################################################ diff --git a/platforms/ros2/src/px4/generic/generic/include/px4_arch/CMakeLists.txt b/platforms/ros2/src/px4/generic/generic/include/px4_arch/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platforms/ros2/src/px4/generic/generic/include/px4_arch/i2c_hw_description.h b/platforms/ros2/src/px4/generic/generic/include/px4_arch/i2c_hw_description.h new file mode 100644 index 0000000000..82e42c1882 --- /dev/null +++ b/platforms/ros2/src/px4/generic/generic/include/px4_arch/i2c_hw_description.h @@ -0,0 +1,53 @@ +/**************************************************************************** + * + * Copyright (C) 2020 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +#pragma once + +#include + + +static inline constexpr px4_i2c_bus_t initI2CBusInternal(int bus) +{ + px4_i2c_bus_t ret{}; + ret.bus = bus; + ret.is_external = false; + return ret; +} + +static inline constexpr px4_i2c_bus_t initI2CBusExternal(int bus) +{ + px4_i2c_bus_t ret{}; + ret.bus = bus; + ret.is_external = true; + return ret; +} diff --git a/platforms/ros2/src/px4/generic/generic/include/px4_arch/micro_hal.h b/platforms/ros2/src/px4/generic/generic/include/px4_arch/micro_hal.h new file mode 100644 index 0000000000..d09b73c687 --- /dev/null +++ b/platforms/ros2/src/px4/generic/generic/include/px4_arch/micro_hal.h @@ -0,0 +1,36 @@ +/**************************************************************************** + * + * Copyright (c) 2019 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ +#pragma once + +#include + diff --git a/platforms/ros2/src/px4/generic/generic/include/px4_arch/spi_hw_description.h b/platforms/ros2/src/px4/generic/generic/include/px4_arch/spi_hw_description.h new file mode 100644 index 0000000000..2ecdec5ebb --- /dev/null +++ b/platforms/ros2/src/px4/generic/generic/include/px4_arch/spi_hw_description.h @@ -0,0 +1,59 @@ +/**************************************************************************** + * + * Copyright (C) 2020 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +#pragma once + +#include + +static inline constexpr px4_spi_bus_device_t initSPIDevice(uint8_t devid_driver, uint8_t cs_index) +{ + px4_spi_bus_device_t ret{}; + ret.cs_gpio = 1; // set to some non-zero value to indicate this is used + ret.devid = PX4_SPIDEV_ID(PX4_SPI_DEVICE_ID, cs_index); + ret.devtype_driver = devid_driver; + return ret; +} + +static inline constexpr px4_spi_bus_t initSPIBus(int bus, const px4_spi_bus_devices_t &devices) +{ + px4_spi_bus_t ret{}; + + for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { + ret.devices[i] = devices.devices[i]; + } + + ret.bus = bus; + ret.is_external = false; // all buses are marked internal on Linux + ret.requires_locking = false; + return ret; +} diff --git a/src/drivers/adc/ads1115/CMakeLists.txt b/src/drivers/adc/ads1115/CMakeLists.txt index d65265709d..8d0957d03f 100644 --- a/src/drivers/adc/ads1115/CMakeLists.txt +++ b/src/drivers/adc/ads1115/CMakeLists.txt @@ -37,5 +37,9 @@ px4_add_module( SRCS ads1115_main.cpp ADS1115.cpp + ADS1115.h DEPENDS - ) \ No newline at end of file + px4_work_queue + PUBLICATIONS + "px4::msg::AdcReport /adc_report" + ) diff --git a/src/drivers/adc/board_adc/CMakeLists.txt b/src/drivers/adc/board_adc/CMakeLists.txt index e22c3d2c16..ebfa647399 100644 --- a/src/drivers/adc/board_adc/CMakeLists.txt +++ b/src/drivers/adc/board_adc/CMakeLists.txt @@ -40,4 +40,7 @@ px4_add_module( DEPENDS arch_adc px4_work_queue + PUBLICATIONS + "px4::msg::AdcReport /adc_report" + "px4::msg::SystemPower /system_power" ) diff --git a/src/drivers/barometer/bmp388/CMakeLists.txt b/src/drivers/barometer/bmp388/CMakeLists.txt index 35474254de..a410ceaefd 100644 --- a/src/drivers/barometer/bmp388/CMakeLists.txt +++ b/src/drivers/barometer/bmp388/CMakeLists.txt @@ -42,4 +42,6 @@ px4_add_module( DEPENDS drivers_barometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorBaro /sensor_baro" ) diff --git a/src/drivers/barometer/ms5611/CMakeLists.txt b/src/drivers/barometer/ms5611/CMakeLists.txt index 6faa5b7a46..19801d2720 100644 --- a/src/drivers/barometer/ms5611/CMakeLists.txt +++ b/src/drivers/barometer/ms5611/CMakeLists.txt @@ -46,4 +46,6 @@ px4_add_module( drivers__device drivers_barometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorBaro /sensor_baro" ) diff --git a/src/drivers/bootloaders/CMakeLists.txt b/src/drivers/bootloaders/CMakeLists.txt index 32f514a36a..1d8ab5d108 100644 --- a/src/drivers/bootloaders/CMakeLists.txt +++ b/src/drivers/bootloaders/CMakeLists.txt @@ -39,10 +39,10 @@ add_dependencies(drivers_bootloaders prebuild_targets) include_directories(include) target_include_directories(drivers_bootloaders INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(drivers_bootloaders PRIVATE systemlib) +target_link_libraries(drivers_bootloaders PRIVATE crc) # generate bootloader_app_shared_t -if(NOT "${PX4_BOARD_LABEL}" MATCHES "canbootloader") +if(NOT "${PX4_BOARD_LABEL}" MATCHES "canbootloader") set(HW_MAJOR ${uavcanblid_hw_version_major}) set(HW_MINOR ${uavcanblid_hw_version_minor}) set(SW_MAJOR ${uavcanblid_sw_version_major}) diff --git a/src/drivers/bootloaders/boot_alt_app_shared.c b/src/drivers/bootloaders/boot_alt_app_shared.c index ac0b726e85..fa8ee361f5 100644 --- a/src/drivers/bootloaders/boot_alt_app_shared.c +++ b/src/drivers/bootloaders/boot_alt_app_shared.c @@ -45,7 +45,7 @@ #include "boot_alt_app_shared.h" -#include +#include /**************************************************************************** * Name: bootloader_alt_app_shared_read diff --git a/src/drivers/bootloaders/boot_app_shared.c b/src/drivers/bootloaders/boot_app_shared.c index a63efa5430..2e77869317 100644 --- a/src/drivers/bootloaders/boot_app_shared.c +++ b/src/drivers/bootloaders/boot_app_shared.c @@ -46,7 +46,7 @@ #include "arm_arch.h" #include "boot_app_shared.h" -#include +#include #define BOOTLOADER_COMMON_APP_SIGNATURE 0xB0A04150u #define BOOTLOADER_COMMON_BOOTLOADER_SIGNATURE 0xB0A0424Cu diff --git a/src/drivers/camera_capture/CMakeLists.txt b/src/drivers/camera_capture/CMakeLists.txt index 37e9e88b86..1341427db6 100644 --- a/src/drivers/camera_capture/CMakeLists.txt +++ b/src/drivers/camera_capture/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2018 PX4 Development Team. All rights reserved. +# Copyright (c) 2018-2021 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -46,4 +46,7 @@ px4_add_module( camera_capture.cpp DEPENDS arch_io_pins + PUBLICATIONS + "px4::msg::CameraTrigger /camera_trigger" + "px4::msg::PpsCapture /pps_capture" # TODO ) diff --git a/src/drivers/camera_trigger/CMakeLists.txt b/src/drivers/camera_trigger/CMakeLists.txt index 77604edfc0..020639f0d1 100644 --- a/src/drivers/camera_trigger/CMakeLists.txt +++ b/src/drivers/camera_trigger/CMakeLists.txt @@ -50,4 +50,7 @@ px4_add_module( interfaces/src/gpio.cpp DEPENDS px4_work_queue + PUBLICATIONS + "px4::msg::CameraTrigger /camera_trigger" + "px4::msg::PpsCapture /pps_capture" # TODO ) diff --git a/src/drivers/differential_pressure/ets/CMakeLists.txt b/src/drivers/differential_pressure/ets/CMakeLists.txt index fe77c1172c..2a73c6c1d5 100644 --- a/src/drivers/differential_pressure/ets/CMakeLists.txt +++ b/src/drivers/differential_pressure/ets/CMakeLists.txt @@ -38,4 +38,6 @@ px4_add_module( ets_airspeed.cpp DEPENDS drivers__airspeed + PUBLICATIONS + "px4::msg::DifferentialPressure /differential_pressure" ) diff --git a/src/drivers/differential_pressure/ms4525/CMakeLists.txt b/src/drivers/differential_pressure/ms4525/CMakeLists.txt index bac360d01e..b39b77749c 100644 --- a/src/drivers/differential_pressure/ms4525/CMakeLists.txt +++ b/src/drivers/differential_pressure/ms4525/CMakeLists.txt @@ -39,4 +39,6 @@ px4_add_module( DEPENDS drivers__airspeed mathlib + PUBLICATIONS + "px4::msg::DifferentialPressure /differential_pressure" ) diff --git a/src/drivers/differential_pressure/ms5525/CMakeLists.txt b/src/drivers/differential_pressure/ms5525/CMakeLists.txt index 21e4195034..c5e8117050 100644 --- a/src/drivers/differential_pressure/ms5525/CMakeLists.txt +++ b/src/drivers/differential_pressure/ms5525/CMakeLists.txt @@ -40,4 +40,6 @@ px4_add_module( DEPENDS drivers__airspeed mathlib + PUBLICATIONS + "px4::msg::DifferentialPressure /differential_pressure" ) diff --git a/src/drivers/differential_pressure/sdp3x/CMakeLists.txt b/src/drivers/differential_pressure/sdp3x/CMakeLists.txt index 3ba5eba2fe..b852e23311 100644 --- a/src/drivers/differential_pressure/sdp3x/CMakeLists.txt +++ b/src/drivers/differential_pressure/sdp3x/CMakeLists.txt @@ -40,4 +40,6 @@ px4_add_module( DEPENDS drivers__airspeed mathlib + PUBLICATIONS + "px4::msg::DifferentialPressure /differential_pressure" ) diff --git a/src/drivers/distance_sensor/broadcom/afbrs50/CMakeLists.txt b/src/drivers/distance_sensor/broadcom/afbrs50/CMakeLists.txt index 8073128881..efebc420a3 100644 --- a/src/drivers/distance_sensor/broadcom/afbrs50/CMakeLists.txt +++ b/src/drivers/distance_sensor/broadcom/afbrs50/CMakeLists.txt @@ -54,6 +54,8 @@ px4_add_module( px4_work_queue drivers_rangefinder afbrs50_m4_fpu + PUBLICATIONS + "px4::msg::DistanceSensor /distance_sensor" ) target_link_libraries(afbrs50_m4_fpu INTERFACE drivers__distance_sensor__afbrs50) diff --git a/src/drivers/distance_sensor/cm8jl65/CMakeLists.txt b/src/drivers/distance_sensor/cm8jl65/CMakeLists.txt index 44d0e47c63..5b37394a6f 100644 --- a/src/drivers/distance_sensor/cm8jl65/CMakeLists.txt +++ b/src/drivers/distance_sensor/cm8jl65/CMakeLists.txt @@ -41,4 +41,6 @@ px4_add_module( module.yaml DEPENDS drivers_rangefinder + PUBLICATIONS + "px4::msg::DistanceSensor /distance_sensor" ) diff --git a/src/drivers/distance_sensor/gy_us42/CMakeLists.txt b/src/drivers/distance_sensor/gy_us42/CMakeLists.txt index 7d59f37cb4..f11850b845 100644 --- a/src/drivers/distance_sensor/gy_us42/CMakeLists.txt +++ b/src/drivers/distance_sensor/gy_us42/CMakeLists.txt @@ -40,4 +40,6 @@ px4_add_module( DEPENDS drivers_rangefinder px4_work_queue + PUBLICATIONS + "px4::msg::DistanceSensor /distance_sensor" ) diff --git a/src/drivers/distance_sensor/leddar_one/CMakeLists.txt b/src/drivers/distance_sensor/leddar_one/CMakeLists.txt index f76edb15a6..97fe6f46fe 100644 --- a/src/drivers/distance_sensor/leddar_one/CMakeLists.txt +++ b/src/drivers/distance_sensor/leddar_one/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( module.yaml DEPENDS drivers_rangefinder + PUBLICATIONS + "px4::msg::DistanceSensor /distance_sensor" ) diff --git a/src/drivers/distance_sensor/mappydot/CMakeLists.txt b/src/drivers/distance_sensor/mappydot/CMakeLists.txt index 58625fa8eb..d32806a3da 100644 --- a/src/drivers/distance_sensor/mappydot/CMakeLists.txt +++ b/src/drivers/distance_sensor/mappydot/CMakeLists.txt @@ -33,6 +33,8 @@ px4_add_module( MODULE drivers__mappydot MAIN mappydot + PUBLICATIONS + "px4::msg::DistanceSensor /distance_sensor" SRCS MappyDot.cpp DEPENDS diff --git a/src/drivers/dshot/CMakeLists.txt b/src/drivers/dshot/CMakeLists.txt index 757a7a8d24..f20470d6ed 100644 --- a/src/drivers/dshot/CMakeLists.txt +++ b/src/drivers/dshot/CMakeLists.txt @@ -52,4 +52,11 @@ px4_add_module( mixer_module MODULE_CONFIG module.yaml + PUBLICATIONS + "px4::msg::ActuatorOutputs /actuator_outputs" + "px4::msg::EscStatus /esc_status" + SUBSCRIPTIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::ActuatorControls /actuator_controls_1" + "px4::msg::ActuatorControls /actuator_controls_2" ) diff --git a/src/drivers/gps/CMakeLists.txt b/src/drivers/gps/CMakeLists.txt index 96e517f355..6ab1b99d88 100644 --- a/src/drivers/gps/CMakeLists.txt +++ b/src/drivers/gps/CMakeLists.txt @@ -52,4 +52,8 @@ px4_add_module( module.yaml DEPENDS git_gps_devices + PUBLICATIONS + "px4::msg::SensorGps /sensor_gps" + "px4::msg::SatelliteInfo /satellite_info" + "px4::msg::GpsDump /gps_dump" ) diff --git a/src/drivers/heater/CMakeLists.txt b/src/drivers/heater/CMakeLists.txt index 6f1fe2e249..ed19edb6ff 100644 --- a/src/drivers/heater/CMakeLists.txt +++ b/src/drivers/heater/CMakeLists.txt @@ -36,4 +36,6 @@ px4_add_module( COMPILE_FLAGS SRCS heater.cpp + PUBLICATIONS + "px4::msg::HeaterStatus /heater_status" ) diff --git a/src/drivers/imu/bosch/bmi088/CMakeLists.txt b/src/drivers/imu/bosch/bmi088/CMakeLists.txt index 8326953f07..4b791ff78b 100644 --- a/src/drivers/imu/bosch/bmi088/CMakeLists.txt +++ b/src/drivers/imu/bosch/bmi088/CMakeLists.txt @@ -51,4 +51,9 @@ px4_add_module( drivers_accelerometer drivers_gyroscope px4_work_queue + PUBLICATIONS + "px4::msg::SensorAccel /sensor_accel" + "px4::msg::SensorGyro /sensor_gyro" + "px4::msg::SensorAccelFifo /sensor_accel_fifo" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo" ) diff --git a/src/drivers/imu/invensense/icm20602/CMakeLists.txt b/src/drivers/imu/invensense/icm20602/CMakeLists.txt index 05ed93d307..b9acfeb48f 100644 --- a/src/drivers/imu/invensense/icm20602/CMakeLists.txt +++ b/src/drivers/imu/invensense/icm20602/CMakeLists.txt @@ -44,4 +44,9 @@ px4_add_module( drivers_accelerometer drivers_gyroscope px4_work_queue + PUBLICATIONS + "px4::msg::SensorAccel /sensor_accel" + "px4::msg::SensorGyro /sensor_gyro" + "px4::msg::SensorAccelFifo /sensor_accel_fifo" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo" ) diff --git a/src/drivers/imu/invensense/icm42688p/CMakeLists.txt b/src/drivers/imu/invensense/icm42688p/CMakeLists.txt index 8ffd2f7328..81aa7c3ca0 100644 --- a/src/drivers/imu/invensense/icm42688p/CMakeLists.txt +++ b/src/drivers/imu/invensense/icm42688p/CMakeLists.txt @@ -44,4 +44,9 @@ px4_add_module( px4_work_queue drivers_accelerometer drivers_gyroscope + PUBLICATIONS + "px4::msg::SensorAccel /sensor_accel" + "px4::msg::SensorGyro /sensor_gyro" + "px4::msg::SensorAccelFifo /sensor_accel_fifo" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo" ) diff --git a/src/drivers/imu/invensense/mpu6000/CMakeLists.txt b/src/drivers/imu/invensense/mpu6000/CMakeLists.txt index 65af48a8e8..25c3dd5d1a 100644 --- a/src/drivers/imu/invensense/mpu6000/CMakeLists.txt +++ b/src/drivers/imu/invensense/mpu6000/CMakeLists.txt @@ -44,4 +44,9 @@ px4_add_module( drivers_accelerometer drivers_gyroscope px4_work_queue + PUBLICATIONS + "px4::msg::SensorAccel /sensor_accel" + "px4::msg::SensorGyro /sensor_gyro" + "px4::msg::SensorAccelFifo /sensor_accel_fifo" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo" ) diff --git a/src/drivers/irlock/CMakeLists.txt b/src/drivers/irlock/CMakeLists.txt index 7d376f2406..ed06eb4f9d 100644 --- a/src/drivers/irlock/CMakeLists.txt +++ b/src/drivers/irlock/CMakeLists.txt @@ -37,4 +37,6 @@ px4_add_module( -Wno-cast-align # TODO: fix and enable SRCS irlock.cpp + PUBLICATIONS + "px4::msg::IrlockReport /irlock_report" ) diff --git a/src/drivers/magnetometer/akm/ak09916/CMakeLists.txt b/src/drivers/magnetometer/akm/ak09916/CMakeLists.txt index 13c86a7a4d..b445358dc5 100644 --- a/src/drivers/magnetometer/akm/ak09916/CMakeLists.txt +++ b/src/drivers/magnetometer/akm/ak09916/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/akm/ak8963/CMakeLists.txt b/src/drivers/magnetometer/akm/ak8963/CMakeLists.txt index c81e466669..a85a651371 100644 --- a/src/drivers/magnetometer/akm/ak8963/CMakeLists.txt +++ b/src/drivers/magnetometer/akm/ak8963/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/bosch/bmm150/CMakeLists.txt b/src/drivers/magnetometer/bosch/bmm150/CMakeLists.txt index 536d810f28..9f8e27ae22 100644 --- a/src/drivers/magnetometer/bosch/bmm150/CMakeLists.txt +++ b/src/drivers/magnetometer/bosch/bmm150/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/hmc5883/CMakeLists.txt b/src/drivers/magnetometer/hmc5883/CMakeLists.txt index 77b8784629..25a1a0a1c3 100644 --- a/src/drivers/magnetometer/hmc5883/CMakeLists.txt +++ b/src/drivers/magnetometer/hmc5883/CMakeLists.txt @@ -43,5 +43,7 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/isentek/ist8308/CMakeLists.txt b/src/drivers/magnetometer/isentek/ist8308/CMakeLists.txt index 0d74541f4e..e8701191dc 100644 --- a/src/drivers/magnetometer/isentek/ist8308/CMakeLists.txt +++ b/src/drivers/magnetometer/isentek/ist8308/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/isentek/ist8310/CMakeLists.txt b/src/drivers/magnetometer/isentek/ist8310/CMakeLists.txt index c9bc5d6a80..b92c238a48 100644 --- a/src/drivers/magnetometer/isentek/ist8310/CMakeLists.txt +++ b/src/drivers/magnetometer/isentek/ist8310/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/lis3mdl/CMakeLists.txt b/src/drivers/magnetometer/lis3mdl/CMakeLists.txt index 41809d2277..7ff0edf64f 100644 --- a/src/drivers/magnetometer/lis3mdl/CMakeLists.txt +++ b/src/drivers/magnetometer/lis3mdl/CMakeLists.txt @@ -42,4 +42,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/lsm303agr/CMakeLists.txt b/src/drivers/magnetometer/lsm303agr/CMakeLists.txt index 486628bf85..844c818866 100644 --- a/src/drivers/magnetometer/lsm303agr/CMakeLists.txt +++ b/src/drivers/magnetometer/lsm303agr/CMakeLists.txt @@ -39,4 +39,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/lsm9ds1_mag/CMakeLists.txt b/src/drivers/magnetometer/lsm9ds1_mag/CMakeLists.txt index 2776a51aff..3a6f6fe207 100644 --- a/src/drivers/magnetometer/lsm9ds1_mag/CMakeLists.txt +++ b/src/drivers/magnetometer/lsm9ds1_mag/CMakeLists.txt @@ -42,4 +42,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/qmc5883l/CMakeLists.txt b/src/drivers/magnetometer/qmc5883l/CMakeLists.txt index a48c25e38a..e5c3a220cf 100644 --- a/src/drivers/magnetometer/qmc5883l/CMakeLists.txt +++ b/src/drivers/magnetometer/qmc5883l/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/rm3100/CMakeLists.txt b/src/drivers/magnetometer/rm3100/CMakeLists.txt index 7f3f41d191..e165de831b 100644 --- a/src/drivers/magnetometer/rm3100/CMakeLists.txt +++ b/src/drivers/magnetometer/rm3100/CMakeLists.txt @@ -42,4 +42,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/magnetometer/vtrantech/vcm1193l/CMakeLists.txt b/src/drivers/magnetometer/vtrantech/vcm1193l/CMakeLists.txt index 58d28fc1cc..c73c2a0eb4 100644 --- a/src/drivers/magnetometer/vtrantech/vcm1193l/CMakeLists.txt +++ b/src/drivers/magnetometer/vtrantech/vcm1193l/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( DEPENDS drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/drivers/optical_flow/paw3902/CMakeLists.txt b/src/drivers/optical_flow/paw3902/CMakeLists.txt index 3626379ed2..17935cad7c 100644 --- a/src/drivers/optical_flow/paw3902/CMakeLists.txt +++ b/src/drivers/optical_flow/paw3902/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( conversion drivers__device px4_work_queue + PUBLICATIONS + "px4::msg::OpticalFlow /optical_flow" ) diff --git a/src/drivers/optical_flow/pmw3901/CMakeLists.txt b/src/drivers/optical_flow/pmw3901/CMakeLists.txt index 33bb3c4511..b2930733fb 100644 --- a/src/drivers/optical_flow/pmw3901/CMakeLists.txt +++ b/src/drivers/optical_flow/pmw3901/CMakeLists.txt @@ -38,4 +38,6 @@ px4_add_module( pmw3901_main.cpp PMW3901.cpp PMW3901.hpp + PUBLICATIONS + "px4::msg::OpticalFlow /optical_flow" ) diff --git a/src/drivers/optical_flow/px4flow/CMakeLists.txt b/src/drivers/optical_flow/px4flow/CMakeLists.txt index e3928d80d1..344d5da5c6 100644 --- a/src/drivers/optical_flow/px4flow/CMakeLists.txt +++ b/src/drivers/optical_flow/px4flow/CMakeLists.txt @@ -37,4 +37,6 @@ px4_add_module( -Wno-cast-align # TODO: fix and enable SRCS px4flow.cpp + PUBLICATIONS + "px4::msg::OpticalFlow /optical_flow" ) diff --git a/src/drivers/optical_flow/thoneflow/CMakeLists.txt b/src/drivers/optical_flow/thoneflow/CMakeLists.txt index 4fcbd5e4ff..0515f8202f 100644 --- a/src/drivers/optical_flow/thoneflow/CMakeLists.txt +++ b/src/drivers/optical_flow/thoneflow/CMakeLists.txt @@ -38,4 +38,6 @@ px4_add_module( thoneflow_parser.cpp MODULE_CONFIG module.yaml + PUBLICATIONS + "px4::msg::OpticalFlow /optical_flow" ) diff --git a/src/drivers/power_monitor/ina228/CMakeLists.txt b/src/drivers/power_monitor/ina228/CMakeLists.txt index 32af49b463..4753a9bd24 100644 --- a/src/drivers/power_monitor/ina228/CMakeLists.txt +++ b/src/drivers/power_monitor/ina228/CMakeLists.txt @@ -41,4 +41,6 @@ px4_add_module( DEPENDS battery px4_work_queue + PUBLICATIONS + "px4::msg::BatteryStatus /battery_status" ) diff --git a/src/drivers/power_monitor/voxlpm/CMakeLists.txt b/src/drivers/power_monitor/voxlpm/CMakeLists.txt index c1043a7d7d..47719ccf83 100644 --- a/src/drivers/power_monitor/voxlpm/CMakeLists.txt +++ b/src/drivers/power_monitor/voxlpm/CMakeLists.txt @@ -39,4 +39,7 @@ px4_add_module( DEPENDS battery px4_work_queue + PUBLICATIONS + "px4::msg::BatteryStatus /battery_status" + "px4::msg::PowerMonitor /power_monitor" ) diff --git a/src/drivers/pps_capture/CMakeLists.txt b/src/drivers/pps_capture/CMakeLists.txt index cf613393f6..b6940e687f 100644 --- a/src/drivers/pps_capture/CMakeLists.txt +++ b/src/drivers/pps_capture/CMakeLists.txt @@ -44,4 +44,6 @@ px4_add_module( -DPARAM_PREFIX="${PARAM_PREFIX}" SRCS PPSCapture.cpp + PUBLICATIONS + "px4::msg::PpsCapture /pps_capture" ) diff --git a/src/drivers/pwm_input/CMakeLists.txt b/src/drivers/pwm_input/CMakeLists.txt index e3e8a7d32c..1acf6cec04 100644 --- a/src/drivers/pwm_input/CMakeLists.txt +++ b/src/drivers/pwm_input/CMakeLists.txt @@ -38,4 +38,6 @@ px4_add_module( -Wno-cast-align # TODO: fix and enable SRCS pwm_input.cpp + PUBLICATIONS + "px4::msg::PwmInput /pwm_input" ) diff --git a/src/drivers/pwm_out/CMakeLists.txt b/src/drivers/pwm_out/CMakeLists.txt index 1e5fa884bc..e732c14d54 100644 --- a/src/drivers/pwm_out/CMakeLists.txt +++ b/src/drivers/pwm_out/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2015-2020 PX4 Development Team. All rights reserved. +# Copyright (c) 2015-2022 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -51,4 +51,10 @@ px4_add_module( arch_io_pins mixer mixer_module + PUBLICATIONS + "px4::msg::ActuatorOutputs /actuator_outputs" + SUBSCRIPTIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::ActuatorControls /actuator_controls_1" + "px4::msg::ActuatorControls /actuator_controls_2" ) diff --git a/src/drivers/pwm_out_sim/CMakeLists.txt b/src/drivers/pwm_out_sim/CMakeLists.txt index 49e6a87117..66517691fd 100644 --- a/src/drivers/pwm_out_sim/CMakeLists.txt +++ b/src/drivers/pwm_out_sim/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2015 PX4 Development Team. All rights reserved. +# Copyright (c) 2015-2022 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -47,4 +47,10 @@ px4_add_module( DEPENDS mixer mixer_module + PUBLICATIONS + "px4::msg::ActuatorOutputs /actuator_outputs" + SUBSCRIPTIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::ActuatorControls /actuator_controls_1" + "px4::msg::ActuatorControls /actuator_controls_2" ) diff --git a/src/drivers/px4io/CMakeLists.txt b/src/drivers/px4io/CMakeLists.txt index afb5d189fb..2e77f7fcf2 100644 --- a/src/drivers/px4io/CMakeLists.txt +++ b/src/drivers/px4io/CMakeLists.txt @@ -45,6 +45,14 @@ px4_add_module( arch_px4io_serial circuit_breaker mixer_module + PUBLICATIONS + "px4::msg::InputRc /input_rc" + "px4::msg::Px4ioStatus /px4io_status" + "px4::msg::Safety /safety" + SUBSCRIPTIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::ActuatorControls /actuator_controls_1" + "px4::msg::ActuatorControls /actuator_controls_2" ) # include the px4io binary in ROMFS diff --git a/src/drivers/rc_input/CMakeLists.txt b/src/drivers/rc_input/CMakeLists.txt index 6c58fb2605..1c3104128e 100644 --- a/src/drivers/rc_input/CMakeLists.txt +++ b/src/drivers/rc_input/CMakeLists.txt @@ -42,4 +42,6 @@ px4_add_module( module.yaml DEPENDS rc + PUBLICATIONS + "px4::msg::InputRc /input_rc" ) diff --git a/src/drivers/roboclaw/CMakeLists.txt b/src/drivers/roboclaw/CMakeLists.txt index 5543f89146..95ee0ea260 100644 --- a/src/drivers/roboclaw/CMakeLists.txt +++ b/src/drivers/roboclaw/CMakeLists.txt @@ -39,5 +39,7 @@ px4_add_module( RoboClaw.cpp MODULE_CONFIG module.yaml + PUBLICATIONS + "px4::msg::WheelEncoders /wheel_encoders" ) diff --git a/src/drivers/rpm/pcf8583/CMakeLists.txt b/src/drivers/rpm/pcf8583/CMakeLists.txt index 9eef9031a7..ecebf38084 100644 --- a/src/drivers/rpm/pcf8583/CMakeLists.txt +++ b/src/drivers/rpm/pcf8583/CMakeLists.txt @@ -41,4 +41,6 @@ px4_add_module( DEPENDS drivers__device px4_work_queue + PUBLICATIONS + "px4::msg::Rpm /rpm" ) diff --git a/src/drivers/rpm/rpm_simulator/CMakeLists.txt b/src/drivers/rpm/rpm_simulator/CMakeLists.txt index 0cf7ad37db..2ca3dd701b 100644 --- a/src/drivers/rpm/rpm_simulator/CMakeLists.txt +++ b/src/drivers/rpm/rpm_simulator/CMakeLists.txt @@ -36,4 +36,6 @@ px4_add_module( SRCS rpm_simulator.cpp DEPENDS + PUBLICATIONS + "px4::msg::Rpm /rpm" ) diff --git a/src/drivers/safety_button/CMakeLists.txt b/src/drivers/safety_button/CMakeLists.txt index f1fb9c3e6b..4c32057712 100644 --- a/src/drivers/safety_button/CMakeLists.txt +++ b/src/drivers/safety_button/CMakeLists.txt @@ -39,4 +39,9 @@ px4_add_module( DEPENDS circuit_breaker px4_work_queue + PUBLICATIONS + "px4::msg::LedControl /led_control" + "px4::msg::Safety /safety" + "px4::msg::TuneControl /tune_control" + "px4::msg::VehicleCommand /vehicle_command" # TODO srv ) diff --git a/src/drivers/tap_esc/CMakeLists.txt b/src/drivers/tap_esc/CMakeLists.txt index 4ef6473932..6ba918d6b6 100644 --- a/src/drivers/tap_esc/CMakeLists.txt +++ b/src/drivers/tap_esc/CMakeLists.txt @@ -48,4 +48,11 @@ px4_add_module( mixer mixer_module tunes + PUBLICATIONS + "px4::msg::ActuatorOutputs /actuator_outputs" + "px4::msg::EscStatus /esc_status" + SUBSCRIPTIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::ActuatorControls /actuator_controls_1" + "px4::msg::ActuatorControls /actuator_controls_2" ) diff --git a/src/drivers/telemetry/frsky_telemetry/CMakeLists.txt b/src/drivers/telemetry/frsky_telemetry/CMakeLists.txt index 719227703b..d351e5f34e 100644 --- a/src/drivers/telemetry/frsky_telemetry/CMakeLists.txt +++ b/src/drivers/telemetry/frsky_telemetry/CMakeLists.txt @@ -40,5 +40,7 @@ px4_add_module( frsky_telemetry.cpp MODULE_CONFIG module.yaml + SUBSCRIPTIONS + "px4::msg::VehicleGlobalPosition /vehicle_global_position" ) diff --git a/src/drivers/telemetry/iridiumsbd/CMakeLists.txt b/src/drivers/telemetry/iridiumsbd/CMakeLists.txt index ec289764b9..8612675d28 100644 --- a/src/drivers/telemetry/iridiumsbd/CMakeLists.txt +++ b/src/drivers/telemetry/iridiumsbd/CMakeLists.txt @@ -40,4 +40,6 @@ px4_add_module( MODULE_CONFIG module.yaml DEPENDS + PUBLICATIONS + "px4::msg::IridiumsbdStatus /iridiumsbd_status" ) diff --git a/src/drivers/test_ppm/test_ppm.cpp b/src/drivers/test_ppm/test_ppm.cpp index 0e817ef8c9..3b280c9ad3 100644 --- a/src/drivers/test_ppm/test_ppm.cpp +++ b/src/drivers/test_ppm/test_ppm.cpp @@ -55,7 +55,6 @@ #include #include -#include #include #include diff --git a/src/drivers/tone_alarm/CMakeLists.txt b/src/drivers/tone_alarm/CMakeLists.txt index 3e9f6ba482..0ff8df226d 100644 --- a/src/drivers/tone_alarm/CMakeLists.txt +++ b/src/drivers/tone_alarm/CMakeLists.txt @@ -43,4 +43,6 @@ px4_add_module( circuit_breaker arch_tone_alarm tunes + PUBLICATIONS + "px4::msg::TuneControl /tune_control" ) diff --git a/src/drivers/uavcan/CMakeLists.txt b/src/drivers/uavcan/CMakeLists.txt index 74cb613942..4f4364236a 100644 --- a/src/drivers/uavcan/CMakeLists.txt +++ b/src/drivers/uavcan/CMakeLists.txt @@ -185,4 +185,10 @@ px4_add_module( # within libuavcan uavcan + + PUBLICATIONS + "px4::msg::EscStatus /esc_status" + "px4::msg::GpsInjectData /gps_inject_data" + "px4::msg::UavcanParameterValue /uavcan_parameter_value" # TODO: srv + "px4::msg::InternalCombustionEngineStatus /internal_combustion_engine_status" ) diff --git a/src/drivers/uavcannode/CMakeLists.txt b/src/drivers/uavcannode/CMakeLists.txt index c7d6200114..905a6a0f25 100644 --- a/src/drivers/uavcannode/CMakeLists.txt +++ b/src/drivers/uavcannode/CMakeLists.txt @@ -153,4 +153,23 @@ px4_add_module( # within libuavcan uavcan + PUBLICATIONS + "px4::msg::GpsInjectData /gps_inject_data" + "px4::msg::LedControl /led_control" + "px4::msg::TuneControl /tune_control" + SUBSCRIPTIONS + "px4::msg::ActuatorArmed /actuator_armed" + "px4::msg::BatteryStatus /battery_status" + "px4::msg::DifferentialPressure /differential_pressure" + "px4::msg::DistanceSensor /distance_sensor" + "px4::msg::Event /event" + "px4::msg::LedControl /led_control" + "px4::msg::LogMessage /log_message" + "px4::msg::MavlinkLog /mavlink_log" + "px4::msg::OpticalFlow /optical_flow" + "px4::msg::ParameterUpdate /parameter_update" + "px4::msg::Safety /safety" + "px4::msg::SensorBaro /sensor_baro" + "px4::msg::SensorGps /sensor_gps" + "px4::msg::SensorMag /sensor_mag" ) diff --git a/src/examples/fake_imu/CMakeLists.txt b/src/examples/fake_imu/CMakeLists.txt index 2d037d7387..636d6d90b9 100644 --- a/src/examples/fake_imu/CMakeLists.txt +++ b/src/examples/fake_imu/CMakeLists.txt @@ -43,4 +43,10 @@ px4_add_module( drivers_accelerometer drivers_gyroscope px4_work_queue + PUBLICATIONS + "px4::msg::EscStatus /esc_status" + "px4::msg::SensorGyro /sensor_gyro" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo" + "px4::msg::SensorAccel /sensor_accel" + "px4::msg::SensorAccelFifo /sensor_accel_fifo" ) diff --git a/src/examples/fixedwing_control/main.cpp b/src/examples/fixedwing_control/main.cpp index a37b93983e..856c299dcf 100644 --- a/src/examples/fixedwing_control/main.cpp +++ b/src/examples/fixedwing_control/main.cpp @@ -307,7 +307,7 @@ int fixedwing_control_thread_main(int argc, char *argv[]) * Advertise that this controller will publish actuator * control values and the rate setpoint */ - orb_advert_t actuator_pub = orb_advertise(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, &actuators); + orb_advert_t actuator_pub = orb_advertise(ORB_ID(actuator_controls_0), &actuators); orb_advert_t rates_pub = orb_advertise(ORB_ID(vehicle_rates_setpoint), &rates_sp); /* subscribe to topics. */ @@ -404,7 +404,7 @@ int fixedwing_control_thread_main(int argc, char *argv[]) PX4_ISFINITE(actuators.control[1]) && PX4_ISFINITE(actuators.control[2]) && PX4_ISFINITE(actuators.control[3])) { - orb_publish(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_pub, &actuators); + orb_publish(ORB_ID(actuator_controls_0), actuator_pub, &actuators); if (verbose) { warnx("published"); @@ -422,7 +422,7 @@ int fixedwing_control_thread_main(int argc, char *argv[]) actuators.control[i] = 0.0f; } - orb_publish(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_pub, &actuators); + orb_publish(ORB_ID(actuator_controls_0), actuator_pub, &actuators); fflush(stdout); diff --git a/src/examples/px4_simple_app/CMakeLists.txt b/src/examples/px4_simple_app/CMakeLists.txt index 6a91bc47e1..7689c1e004 100644 --- a/src/examples/px4_simple_app/CMakeLists.txt +++ b/src/examples/px4_simple_app/CMakeLists.txt @@ -34,6 +34,6 @@ px4_add_module( MODULE examples__px4_simple_app MAIN px4_simple_app SRCS - px4_simple_app.c + px4_simple_app.cpp DEPENDS ) diff --git a/src/examples/px4_simple_app/px4_simple_app.c b/src/examples/px4_simple_app/px4_simple_app.cpp similarity index 97% rename from src/examples/px4_simple_app/px4_simple_app.c rename to src/examples/px4_simple_app/px4_simple_app.cpp index c9f9d61927..1765f7e76e 100644 --- a/src/examples/px4_simple_app/px4_simple_app.c +++ b/src/examples/px4_simple_app/px4_simple_app.cpp @@ -51,9 +51,7 @@ #include #include -__EXPORT int px4_simple_app_main(int argc, char *argv[]); - -int px4_simple_app_main(int argc, char *argv[]) +extern "C" __EXPORT int px4_simple_app_main(int argc, char *argv[]) { PX4_INFO("Hello Sky!"); diff --git a/src/examples/rover_steering_control/main.cpp b/src/examples/rover_steering_control/main.cpp index ae00604e60..eeac6f13c6 100644 --- a/src/examples/rover_steering_control/main.cpp +++ b/src/examples/rover_steering_control/main.cpp @@ -261,7 +261,7 @@ int rover_steering_control_thread_main(int argc, char *argv[]) * Advertise that this controller will publish actuator * control values and the rate setpoint */ - orb_advert_t actuator_pub = orb_advertise(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, &actuators); + orb_advert_t actuator_pub = orb_advertise(ORB_ID(actuator_controls_0), &actuators); /* subscribe to topics. */ int att_sub = orb_subscribe(ORB_ID(vehicle_attitude)); @@ -357,7 +357,7 @@ int rover_steering_control_thread_main(int argc, char *argv[]) PX4_ISFINITE(actuators.control[1]) && PX4_ISFINITE(actuators.control[2]) && PX4_ISFINITE(actuators.control[3])) { - orb_publish(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_pub, &actuators); + orb_publish(ORB_ID(actuator_controls_0), actuator_pub, &actuators); if (verbose) { warnx("published"); @@ -377,7 +377,7 @@ int rover_steering_control_thread_main(int argc, char *argv[]) actuators.timestamp = hrt_absolute_time(); - orb_publish(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_pub, &actuators); + orb_publish(ORB_ID(actuator_controls_0), actuator_pub, &actuators); fflush(stdout); diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index dd87dc2dd7..22f8052f29 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -31,43 +31,44 @@ # ############################################################################ -add_subdirectory(airspeed) -add_subdirectory(avoidance) -add_subdirectory(battery) -add_subdirectory(bezier) -add_subdirectory(cdev) -add_subdirectory(circuit_breaker) -add_subdirectory(collision_prevention) -add_subdirectory(component_information) -add_subdirectory(controllib) -add_subdirectory(conversion) -add_subdirectory(crypto) -add_subdirectory(drivers) -add_subdirectory(field_sensor_bias_estimator) -add_subdirectory(geo) -add_subdirectory(hysteresis) -add_subdirectory(l1) -add_subdirectory(landing_slope) -add_subdirectory(led) -add_subdirectory(matrix) -add_subdirectory(mathlib) -add_subdirectory(mixer) -add_subdirectory(mixer_module) -add_subdirectory(motion_planning) -add_subdirectory(npfg) -add_subdirectory(perf) -add_subdirectory(pid) -add_subdirectory(pid_design) -add_subdirectory(pwm) -add_subdirectory(rc) -add_subdirectory(sensor_calibration) -add_subdirectory(slew_rate) -add_subdirectory(systemlib) -add_subdirectory(system_identification) -add_subdirectory(tecs) -add_subdirectory(terrain_estimation) -add_subdirectory(tunes) -add_subdirectory(version) -add_subdirectory(weather_vane) -add_subdirectory(wind_estimator) -add_subdirectory(world_magnetic_model) +add_subdirectory(airspeed EXCLUDE_FROM_ALL) +add_subdirectory(avoidance EXCLUDE_FROM_ALL) +add_subdirectory(battery EXCLUDE_FROM_ALL) +add_subdirectory(bezier EXCLUDE_FROM_ALL) +add_subdirectory(cdev EXCLUDE_FROM_ALL) +add_subdirectory(circuit_breaker EXCLUDE_FROM_ALL) +add_subdirectory(collision_prevention EXCLUDE_FROM_ALL) +add_subdirectory(component_information EXCLUDE_FROM_ALL) +add_subdirectory(controllib EXCLUDE_FROM_ALL) +add_subdirectory(conversion EXCLUDE_FROM_ALL) +add_subdirectory(crc EXCLUDE_FROM_ALL) +add_subdirectory(crypto EXCLUDE_FROM_ALL) +add_subdirectory(drivers EXCLUDE_FROM_ALL) +add_subdirectory(field_sensor_bias_estimator EXCLUDE_FROM_ALL) +add_subdirectory(geo EXCLUDE_FROM_ALL) +add_subdirectory(hysteresis EXCLUDE_FROM_ALL) +add_subdirectory(l1 EXCLUDE_FROM_ALL) +add_subdirectory(landing_slope EXCLUDE_FROM_ALL) +add_subdirectory(led EXCLUDE_FROM_ALL) +add_subdirectory(matrix EXCLUDE_FROM_ALL) +add_subdirectory(mathlib EXCLUDE_FROM_ALL) +add_subdirectory(mixer EXCLUDE_FROM_ALL) +add_subdirectory(mixer_module EXCLUDE_FROM_ALL) +add_subdirectory(motion_planning EXCLUDE_FROM_ALL) +add_subdirectory(npfg EXCLUDE_FROM_ALL) +add_subdirectory(perf EXCLUDE_FROM_ALL) +add_subdirectory(pid EXCLUDE_FROM_ALL) +add_subdirectory(pid_design EXCLUDE_FROM_ALL) +add_subdirectory(pwm EXCLUDE_FROM_ALL) +add_subdirectory(rc EXCLUDE_FROM_ALL) +add_subdirectory(sensor_calibration EXCLUDE_FROM_ALL) +add_subdirectory(slew_rate EXCLUDE_FROM_ALL) +add_subdirectory(systemlib EXCLUDE_FROM_ALL) +add_subdirectory(system_identification EXCLUDE_FROM_ALL) +add_subdirectory(tecs EXCLUDE_FROM_ALL) +add_subdirectory(terrain_estimation EXCLUDE_FROM_ALL) +add_subdirectory(tunes EXCLUDE_FROM_ALL) +add_subdirectory(version EXCLUDE_FROM_ALL) +add_subdirectory(weather_vane EXCLUDE_FROM_ALL) +add_subdirectory(wind_estimator EXCLUDE_FROM_ALL) +add_subdirectory(world_magnetic_model EXCLUDE_FROM_ALL) diff --git a/src/lib/crc/CMakeLists.txt b/src/lib/crc/CMakeLists.txt new file mode 100644 index 0000000000..95b85eb483 --- /dev/null +++ b/src/lib/crc/CMakeLists.txt @@ -0,0 +1,39 @@ +############################################################################ +# +# Copyright (c) 2015-2021 PX4 Development Team. All rights reserved. +# +# 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. +# +############################################################################ + +add_library(crc STATIC + EXCLUDE_FROM_ALL + crc.c crc.h +) +add_dependencies(crc prebuild_targets) +target_compile_options(crc PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) diff --git a/src/lib/systemlib/crc.c b/src/lib/crc/crc.c similarity index 100% rename from src/lib/systemlib/crc.c rename to src/lib/crc/crc.c diff --git a/src/lib/systemlib/crc.h b/src/lib/crc/crc.h similarity index 100% rename from src/lib/systemlib/crc.h rename to src/lib/crc/crc.h diff --git a/src/lib/parameters/CMakeLists.txt b/src/lib/parameters/CMakeLists.txt index 26e909596f..0fea921cbd 100644 --- a/src/lib/parameters/CMakeLists.txt +++ b/src/lib/parameters/CMakeLists.txt @@ -146,9 +146,9 @@ add_custom_command(OUTPUT px4_parameters.hpp px_generate_params.py templates/px4_parameters.hpp.jinja ) +add_custom_target(generate_parameters DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/px4_parameters.hpp) set(SRCS) - list(APPEND SRCS parameters.cpp) if(BUILD_TESTING) list(APPEND SRCS param_translation_unit_tests.cpp) @@ -161,11 +161,9 @@ if(${PX4_PLATFORM} STREQUAL "nuttx") endif() # TODO: find a better way to do this -if (NOT "${PX4_BOARD}" MATCHES "px4_io") - add_library(parameters - ${SRCS} - px4_parameters.hpp - ) +if((NOT "${PX4_BOARD}" MATCHES "px4_io") AND (NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")) + + add_library(parameters STATIC EXCLUDE_FROM_ALL ${SRCS} px4_parameters.hpp) target_link_libraries(parameters PRIVATE perf tinybson px4_layer) target_compile_definitions(parameters PRIVATE -DMODULE_NAME="parameters") @@ -176,7 +174,7 @@ if (NOT "${PX4_BOARD}" MATCHES "px4_io") -Wno-sign-compare # TODO: fix and enable ) else() - add_library(parameters ${PX4_SOURCE_DIR}/platforms/common/empty.c) + add_library(parameters STATIC EXCLUDE_FROM_ALL ${PX4_SOURCE_DIR}/platforms/common/empty.c) endif() add_dependencies(parameters prebuild_targets) diff --git a/src/lib/parameters/tinybson/CMakeLists.txt b/src/lib/parameters/tinybson/CMakeLists.txt index a8d5b43e79..58a635fc9b 100644 --- a/src/lib/parameters/tinybson/CMakeLists.txt +++ b/src/lib/parameters/tinybson/CMakeLists.txt @@ -31,7 +31,7 @@ # ############################################################################ -add_library(tinybson tinybson.cpp) +add_library(tinybson tinybson.cpp tinybson.h) target_compile_definitions(tinybson PRIVATE -DMODULE_NAME="tinybson") target_compile_options(tinybson PRIVATE -Wno-sign-compare) # TODO: fix this add_dependencies(tinybson prebuild_targets) diff --git a/src/lib/systemlib/CMakeLists.txt b/src/lib/systemlib/CMakeLists.txt index 155a1a2b24..726fa7c074 100644 --- a/src/lib/systemlib/CMakeLists.txt +++ b/src/lib/systemlib/CMakeLists.txt @@ -32,17 +32,17 @@ ############################################################################ set(SRCS - conversions.c - conversions.h - crc.c - crc.h + err.h mavlink_log.cpp mavlink_log.h + px4_macros.h ) if(${PX4_PLATFORM} STREQUAL "nuttx") list(APPEND SRCS otp.c + otp.h + ppm_decode.h ) endif() diff --git a/src/lib/systemlib/otp.c b/src/lib/systemlib/otp.c index 0c070a5146..ee1c4f865c 100644 --- a/src/lib/systemlib/otp.c +++ b/src/lib/systemlib/otp.c @@ -49,9 +49,8 @@ #include #include #include // memset -#include "conversions.h" #include "otp.h" -#include "err.h" // warnx +#include "err.h" // warnx #include diff --git a/src/modules/airship_att_control/CMakeLists.txt b/src/modules/airship_att_control/CMakeLists.txt index 9771e2ad51..d5be546482 100644 --- a/src/modules/airship_att_control/CMakeLists.txt +++ b/src/modules/airship_att_control/CMakeLists.txt @@ -40,4 +40,7 @@ px4_add_module( airship_att_control_main.cpp DEPENDS px4_work_queue + PUBLICATIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::VehicleTorqueSetpoint /vehicle_torque_setpoint" ) diff --git a/src/modules/airship_att_control/airship_att_control_main.cpp b/src/modules/airship_att_control/airship_att_control_main.cpp index d642746421..15d0a1a1b8 100644 --- a/src/modules/airship_att_control/airship_att_control_main.cpp +++ b/src/modules/airship_att_control/airship_att_control_main.cpp @@ -190,7 +190,7 @@ int AirshipAttitudeControl::print_status() perf_print_counter(_loop_perf); - print_message(ORB_ID(actuator_controls), _actuators); + print_message(ORB_ID(actuator_controls_0), _actuators); return 0; } diff --git a/src/modules/airspeed_selector/CMakeLists.txt b/src/modules/airspeed_selector/CMakeLists.txt index fb3d24f869..b4988ea5c2 100644 --- a/src/modules/airspeed_selector/CMakeLists.txt +++ b/src/modules/airspeed_selector/CMakeLists.txt @@ -39,4 +39,7 @@ px4_add_module( AirspeedValidator.hpp DEPENDS wind_estimator + PUBLICATIONS + "px4::msg::AirspeedValidated /airspeed_validated" + "px4::msg::AirspeedWind /airspeed_wind" ) diff --git a/src/modules/airspeed_selector/airspeed_selector_main.cpp b/src/modules/airspeed_selector/airspeed_selector_main.cpp index c03937dfe5..4a140b1601 100644 --- a/src/modules/airspeed_selector/airspeed_selector_main.cpp +++ b/src/modules/airspeed_selector/airspeed_selector_main.cpp @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #include #include @@ -120,7 +120,7 @@ private: uORB::Subscription _vehicle_local_position_sub{ORB_ID(vehicle_local_position)}; uORB::Subscription _vehicle_status_sub{ORB_ID(vehicle_status)}; uORB::Subscription _vtol_vehicle_status_sub{ORB_ID(vtol_vehicle_status)}; - uORB::Subscription _position_setpoint_sub{ORB_ID(position_setpoint)}; + uORB::Subscription _position_setpoint_triplet_sub{ORB_ID(position_setpoint_triplet)}; uORB::SubscriptionMultiArray _airspeed_subs{ORB_ID::airspeed}; @@ -132,7 +132,7 @@ private: vehicle_local_position_s _vehicle_local_position {}; vehicle_status_s _vehicle_status {}; vtol_vehicle_status_s _vtol_vehicle_status {}; - position_setpoint_s _position_setpoint {}; + position_setpoint_s _position_setpoint{}; WindEstimator _wind_estimator_sideslip; /**< wind estimator instance only fusing sideslip */ airspeed_wind_s _wind_estimate_sideslip {}; /**< wind estimate message for wind estimator instance only fusing sideslip */ @@ -499,7 +499,14 @@ void AirspeedModule::poll_topics() _vehicle_status_sub.update(&_vehicle_status); _vtol_vehicle_status_sub.update(&_vtol_vehicle_status); _vehicle_local_position_sub.update(&_vehicle_local_position); - _position_setpoint_sub.update(&_position_setpoint); + + if (_position_setpoint_triplet_sub.updated()) { + position_setpoint_triplet_s position_setpoint_triplet; + + if (_position_setpoint_triplet_sub.update(&position_setpoint_triplet)) { + _position_setpoint = position_setpoint_triplet.current; + } + } _vehicle_local_position_valid = (_time_now_usec - _vehicle_local_position.timestamp < 1_s) diff --git a/src/modules/angular_velocity_controller/CMakeLists.txt b/src/modules/angular_velocity_controller/CMakeLists.txt index 4cfc369db7..3e191fe6f3 100644 --- a/src/modules/angular_velocity_controller/CMakeLists.txt +++ b/src/modules/angular_velocity_controller/CMakeLists.txt @@ -46,4 +46,9 @@ px4_add_module( mathlib AngularVelocityControl px4_work_queue + PUBLICATIONS + "px4::msg::RateCtrlStatus /rate_ctrl_status" + "px4::msg::VehicleAngularAccelerationSetpoint /vehicle_angular_acceleration_setpoint" + "px4::msg::VehicleThrustSetpoint /vehicle_thrust_setpoint" + "px4::msg::VehicleTorqueSetpoint /vehicle_torque_setpoint" ) diff --git a/src/modules/attitude_estimator_q/CMakeLists.txt b/src/modules/attitude_estimator_q/CMakeLists.txt index df9084fe20..5f7dc6b401 100644 --- a/src/modules/attitude_estimator_q/CMakeLists.txt +++ b/src/modules/attitude_estimator_q/CMakeLists.txt @@ -40,5 +40,7 @@ px4_add_module( attitude_estimator_q_main.cpp DEPENDS world_magnetic_model + PUBLICATIONS + "px4::msg::VehicleAttitude /vehicle_attitude" ) diff --git a/src/modules/battery_status/CMakeLists.txt b/src/modules/battery_status/CMakeLists.txt index df7c9967d4..f06516a31c 100644 --- a/src/modules/battery_status/CMakeLists.txt +++ b/src/modules/battery_status/CMakeLists.txt @@ -39,6 +39,8 @@ px4_add_module( analog_battery.cpp MODULE_CONFIG module.yaml + PUBLICATIONS + "px4::msg::BatteryStatus /battery_status" DEPENDS battery conversion diff --git a/src/modules/camera_feedback/CMakeLists.txt b/src/modules/camera_feedback/CMakeLists.txt index 152f2c1eae..c7d250709e 100644 --- a/src/modules/camera_feedback/CMakeLists.txt +++ b/src/modules/camera_feedback/CMakeLists.txt @@ -38,4 +38,6 @@ px4_add_module( CameraFeedback.hpp DEPENDS px4_work_queue + PUBLICATIONS + "px4::msg::CameraCapture /camera_capture" ) diff --git a/src/modules/commander/CMakeLists.txt b/src/modules/commander/CMakeLists.txt index 9a68a8f184..2adbf820ab 100644 --- a/src/modules/commander/CMakeLists.txt +++ b/src/modules/commander/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2015 PX4 Development Team. All rights reserved. +# Copyright (c) 2015-2021 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -37,7 +37,42 @@ add_subdirectory(Arming) px4_add_module( MODULE modules__commander MAIN commander - COMPILE_FLAGS + PUBLICATIONS + "px4::msg::ActuatorArmed /actuator_armed" + "px4::msg::ActuatorTest /actuator_test" + "px4::msg::CommanderState /commander_state" + "px4::msg::FailureDetectorStatus /failure_detector_status" + "px4::msg::LedControl /led_control" + "px4::msg::HomePosition /home_position" + "px4::msg::MavlinkLog /mavlink_log" + "px4::msg::LogMessage /log_message" + "px4::msg::MagWorkerData /mag_worker_data" + "px4::msg::Event /event" + "px4::msg::Mission /mission" + "px4::msg::TestMotor /test_motor" + "px4::msg::TuneControl /tune_control" + "px4::msg::VehicleCommand /vehicle_command" # TODO: srv + "px4::msg::VehicleCommandAck /vehicle_command_ack" # TODO: srv + "px4::msg::VehicleControlMode /vehicle_control_mode" + "px4::msg::VehicleStatus /vehicle_status" + "px4::msg::VehicleStatusFlags /vehicle_status_flags" + SUBSCRIPTIONS + "px4::msg::ParameterUpdate /parameter_update" # TODO: parameter server + + "px4::msg::AirspeedValidated /airspeed_validated" + "px4::msg::Cpuload /cpuload" + "px4::msg::DifferentialPressure /differential_pressure" # airspeed calibration + "px4::msg::EscStatus /esc_status" + "px4::msg::EstimatorSelectorStatus /estimator_selector_status" + "px4::msg::EstimatorStatus /estimator_status" + "px4::msg::EstimatorSensorBias /estimator_sensor_bias" + "px4::msg::PwmInput /pwm_input" # TODO: + "px4::msg::IridiumsbdStatus /iridiumsbd_status" # TODO: + "px4::msg::Safety /safety" # TODO: SITL + "px4::msg::SystemPower /system_power" # TODO: SITL + "px4::msg::PowerButtonState /power_button_state" # TODO: SITL + "px4::msg::VtolVehicleStatus /vtol_vehicle_status" + "px4::msg::Wind /wind" SRCS accelerometer_calibration.cpp airspeed_calibration.cpp diff --git a/src/modules/commander/Commander.hpp b/src/modules/commander/Commander.hpp index 0ec1bd576f..f386c814c8 100644 --- a/src/modules/commander/Commander.hpp +++ b/src/modules/commander/Commander.hpp @@ -45,6 +45,8 @@ #include #include +#include + // publications #include #include @@ -404,7 +406,7 @@ private: // Subscriptions uORB::Subscription _action_request_sub {ORB_ID(action_request)}; - uORB::Subscription _actuator_controls_sub{ORB_ID_VEHICLE_ATTITUDE_CONTROLS}; + uORB::Subscription _actuator_controls_sub{ORB_ID(actuator_controls_0)}; uORB::Subscription _cmd_sub {ORB_ID(vehicle_command)}; uORB::Subscription _cpuload_sub{ORB_ID(cpuload)}; uORB::Subscription _esc_status_sub{ORB_ID(esc_status)}; diff --git a/src/modules/control_allocator/CMakeLists.txt b/src/modules/control_allocator/CMakeLists.txt index a3ab199f26..d8de44e450 100644 --- a/src/modules/control_allocator/CMakeLists.txt +++ b/src/modules/control_allocator/CMakeLists.txt @@ -53,4 +53,16 @@ px4_add_module( ControlAllocation mixer px4_work_queue + PUBLICATIONS + + "px4::msg::ActuatorMotors /actuator_motors" + "px4::msg::ActuatorServos /actuator_servos" + "px4::msg::ActuatorServosTrim /actuator_servos_trim" + "px4::msg::ControlAllocatorStatus /control_allocator_status" + SUBSCRIPTIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::ActuatorControls /actuator_controls_1" + "px4::msg::ActuatorControls /actuator_controls_2" + "px4::msg::VehicleTorqueSetpoint /vehicle_torque_setpoint" + "px4::msg::VehicleThrustSetpoint /vehicle_thrust_setpoint" ) diff --git a/src/modules/ekf2/CMakeLists.txt b/src/modules/ekf2/CMakeLists.txt index 48b9ab8b7e..4edfdadd15 100644 --- a/src/modules/ekf2/CMakeLists.txt +++ b/src/modules/ekf2/CMakeLists.txt @@ -82,6 +82,37 @@ px4_add_module( px4_work_queue world_magnetic_model UNITY_BUILD + PUBLICATIONS + "px4::msg::Ekf2Timestamps /ekf2_timestamps" + "px4::msg::EkfGpsDrift /ekf_gps_drift" + "px4::msg::EstimatorBaroBias /estimator_baro_bias" + "px4::msg::EstimatorInnovations /estimator_innovations" + "px4::msg::EstimatorInnovations /estimator_innovation_test_ratios" + "px4::msg::EstimatorInnovations /estimator_innovation_variances" + "px4::msg::EstimatorOpticalFlowVel /estimator_optical_flow_vel" + "px4::msg::EstimatorSensorBias /estimator_sensor_bias" + "px4::msg::EstimatorStates /estimator_states" + "px4::msg::EstimatorStatus /estimator_status" + "px4::msg::EstimatorStatusFlags /estimator_status_flags" + "px4::msg::EstimatorEventFlags /estimator_event_flags" + "px4::msg::VehicleOdometry /estimator_visual_odometry_aligned" + "px4::msg::YawEstimatorStatus /yaw_estimator_status" + + "px4::msg::VehicleAttitude /vehicle_attitude" + "px4::msg::VehicleLocalPosition /vehicle_local_position" + "px4::msg::VehicleGlobalPosition /vehicle_global_position" + "px4::msg::VehicleOdometry /vehicle_odometry" + "px4::msg::Wind /wind" + + # multi-EKF + "px4::msg::EstimatorSelectorStatus /estimator_selector_status" + "px4::msg::VehicleAttitude /estimator_attitude" + "px4::msg::VehicleLocalPosition /estimator_local_position" + "px4::msg::VehicleGlobalPosition /estimator_global_position" + "px4::msg::VehicleOdometry /estimator_odometry" + "px4::msg::Wind /estimator_wind" + SUBSCRIPTIONS + "px4::msg::OpticalFlow /optical_flow" ) if(BUILD_TESTING) diff --git a/src/modules/flight_mode_manager/CMakeLists.txt b/src/modules/flight_mode_manager/CMakeLists.txt index 1d8e82bf98..da8b40a7f6 100644 --- a/src/modules/flight_mode_manager/CMakeLists.txt +++ b/src/modules/flight_mode_manager/CMakeLists.txt @@ -127,6 +127,20 @@ px4_add_module( px4_work_queue WeatherVane flighttasks_generated + PUBLICATIONS + "px4::msg::LandingGear /landing_gear" + "px4::msg::VehicleLocalPositionSetpoint /trajectory_setpoint" + "px4::msg::VehicleConstraints /vehicle_constraints" + "px4::msg::OrbitStatus /orbit_status" + "px4::msg::CollisionConstraints /collision_constraints" + "px4::msg::ObstacleDistance /obstacle_distance_fused" + "px4::msg::ObstacleDistance /obstacle_distance" + "px4::msg::VehicleTrajectoryBezier /vehicle_trajectory_bezier" + "px4::msg::VehicleTrajectoryWaypoint /vehicle_trajectory_waypoint" + "px4::msg::VehicleTrajectoryWaypoint /vehicle_trajectory_waypoint_desired" + SUBSCRIPTIONS + "px4::msg::VehicleLocalPosition /vehicle_local_position" + "px4::msg::VehicleLocalPositionSetpoint /vehicle_local_position_setpoint" ) # add all flight task dependencies diff --git a/src/modules/fw_att_control/CMakeLists.txt b/src/modules/fw_att_control/CMakeLists.txt index a8c79cf31c..4063b01733 100644 --- a/src/modules/fw_att_control/CMakeLists.txt +++ b/src/modules/fw_att_control/CMakeLists.txt @@ -44,4 +44,15 @@ px4_add_module( ecl_yaw_controller.cpp DEPENDS px4_work_queue + PUBLICATIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::ActuatorControls /actuator_controls_virtual_fw" # VTOL + "px4::msg::ActuatorControlsStatus /actuator_controls_status_0" + "px4::msg::ActuatorControlsStatus /actuator_controls_status_1" # VTOL + "px4::msg::VehicleAttitudeSetpoint /vehicle_attitude_setpoint" + "px4::msg::VehicleAttitudeSetpoint /fw_virtual_attitude_setpoint" # VTOL + "px4::msg::VehicleRatesSetpoint /vehicle_rates_setpoint" + "px4::msg::RateCtrlStatus /rate_ctrl_status" + "px4::msg::VehicleTorqueSetpoint /vehicle_torque_setpoint" + "px4::msg::VehicleThrustSetpoint /vehicle_thrust_setpoint" ) diff --git a/src/modules/fw_autotune_attitude_control/CMakeLists.txt b/src/modules/fw_autotune_attitude_control/CMakeLists.txt index 3c898a21ac..4630cbc931 100644 --- a/src/modules/fw_autotune_attitude_control/CMakeLists.txt +++ b/src/modules/fw_autotune_attitude_control/CMakeLists.txt @@ -44,4 +44,6 @@ px4_add_module( mathlib px4_work_queue SystemIdentification + PUBLICATIONS + "px4::msg::AutotuneAttitudeControlStatus /autotune_attitude_control_status" ) diff --git a/src/modules/fw_pos_control_l1/CMakeLists.txt b/src/modules/fw_pos_control_l1/CMakeLists.txt index 2404723694..3881728d24 100644 --- a/src/modules/fw_pos_control_l1/CMakeLists.txt +++ b/src/modules/fw_pos_control_l1/CMakeLists.txt @@ -48,4 +48,12 @@ px4_add_module( runway_takeoff SlewRate tecs + PUBLICATIONS + "px4::msg::VehicleAttitudeSetpoint /vehicle_attitude_setpoint" + "px4::msg::VehicleAttitudeSetpoint /fw_virtual_attitude_setpoint" # VTOL + "px4::msg::PositionControllerStatus /position_controller_status" + "px4::msg::PositionControllerLandingStatus /position_controller_landing_status" + "px4::msg::NpfgStatus /npfg_status" + "px4::msg::OrbitStatus /orbit_status" + "px4::msg::TecsStatus /tecs_status" ) diff --git a/src/modules/gyro_fft/CMakeLists.txt b/src/modules/gyro_fft/CMakeLists.txt index 85c6bbf461..52ea30ee52 100644 --- a/src/modules/gyro_fft/CMakeLists.txt +++ b/src/modules/gyro_fft/CMakeLists.txt @@ -77,4 +77,6 @@ px4_add_module( ${CMSIS_DSP}/Source/TransformFunctions/arm_rfft_q15.c DEPENDS px4_work_queue + PUBLICATIONS + "px4::msg::SensorGyroFft /sensor_gyro_fft" ) diff --git a/src/modules/land_detector/CMakeLists.txt b/src/modules/land_detector/CMakeLists.txt index 632c90d5cf..8559af764f 100644 --- a/src/modules/land_detector/CMakeLists.txt +++ b/src/modules/land_detector/CMakeLists.txt @@ -44,5 +44,12 @@ px4_add_module( AirshipLandDetector.cpp DEPENDS hysteresis + px4_work_queue + PUBLICATIONS + "px4::msg::VehicleLandDetected /vehicle_land_detected" + SUBSCRIPTIONS + "px4::msg::HoverThrustEstimate /hover_thrust_estimate" + "px4::msg::TakeoffStatus /takeoff_status" + "px4::msg::VehicleLocalPositionSetpoint /trajectory_setpoint" ) diff --git a/src/modules/landing_target_estimator/CMakeLists.txt b/src/modules/landing_target_estimator/CMakeLists.txt index 146869aa3f..7c6214203d 100644 --- a/src/modules/landing_target_estimator/CMakeLists.txt +++ b/src/modules/landing_target_estimator/CMakeLists.txt @@ -40,5 +40,8 @@ px4_add_module( LandingTargetEstimator.cpp KalmanFilter.cpp DEPENDS + PUBLICATIONS + "px4::msg::LandingTargetPose /landing_target_pose" + "px4::msg::LandingTargetInnovations /landing_target_innovations" ) diff --git a/src/modules/load_mon/CMakeLists.txt b/src/modules/load_mon/CMakeLists.txt index a2c6ee0647..66f0358184 100644 --- a/src/modules/load_mon/CMakeLists.txt +++ b/src/modules/load_mon/CMakeLists.txt @@ -39,4 +39,7 @@ px4_add_module( LoadMon.hpp DEPENDS px4_work_queue + PUBLICATIONS + "px4::msg::Cpuload /cpuload" + "px4::msg::TaskStackInfo /task_stack_info" ) diff --git a/src/modules/logger/CMakeLists.txt b/src/modules/logger/CMakeLists.txt index 58ecc3f837..fd467c20a0 100644 --- a/src/modules/logger/CMakeLists.txt +++ b/src/modules/logger/CMakeLists.txt @@ -48,4 +48,7 @@ px4_add_module( watchdog.cpp DEPENDS version + PUBLICATIONS + "px4::msg::LoggerStatus /logger_status" + "px4::msg::UlogStream /ulog_stream" ) diff --git a/src/modules/logger/logged_topics.cpp b/src/modules/logger/logged_topics.cpp index 35c97b7372..c0bbbb7c88 100644 --- a/src/modules/logger/logged_topics.cpp +++ b/src/modules/logger/logged_topics.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include diff --git a/src/modules/logger/logged_topics.h b/src/modules/logger/logged_topics.h index b69e06b213..8aeba0c169 100644 --- a/src/modules/logger/logged_topics.h +++ b/src/modules/logger/logged_topics.h @@ -36,7 +36,7 @@ #include #include -#include +#include namespace px4 { diff --git a/src/modules/logger/logger.cpp b/src/modules/logger/logger.cpp index 491f2a0baa..e6f15da8c9 100644 --- a/src/modules/logger/logger.cpp +++ b/src/modules/logger/logger.cpp @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/modules/mag_bias_estimator/CMakeLists.txt b/src/modules/mag_bias_estimator/CMakeLists.txt index d52a439d3c..c1ce938081 100644 --- a/src/modules/mag_bias_estimator/CMakeLists.txt +++ b/src/modules/mag_bias_estimator/CMakeLists.txt @@ -40,4 +40,6 @@ px4_add_module( MagBiasEstimator.hpp DEPENDS px4_work_queue + PUBLICATIONS + "px4::msg::MagnetometerBiasEstimate /magnetometer_bias_estimate" ) diff --git a/src/modules/manual_control/CMakeLists.txt b/src/modules/manual_control/CMakeLists.txt index c96478afdf..265fd1d018 100644 --- a/src/modules/manual_control/CMakeLists.txt +++ b/src/modules/manual_control/CMakeLists.txt @@ -43,6 +43,11 @@ px4_add_module( ManualControlSelector.cpp DEPENDS px4_work_queue + PUBLICATIONS + "px4::msg::ActionRequest /action_request" + "px4::msg::LandingGear /landing_gear" + "px4::msg::ManualControlSetpoint /manual_control_input" + "px4::msg::ManualControlSetpoint /manual_control_setpoint" ) px4_add_unit_gtest(SRC ManualControlSelectorTest.cpp LINKLIBS module__manual_control) diff --git a/src/modules/mavlink/CMakeLists.txt b/src/modules/mavlink/CMakeLists.txt index 34e3640017..3ce1e4c64a 100644 --- a/src/modules/mavlink/CMakeLists.txt +++ b/src/modules/mavlink/CMakeLists.txt @@ -111,6 +111,74 @@ px4_add_module( tunes version UNITY_BUILD + PUBLICATIONS + "px4::msg::Mission /mission" + "px4::msg::RcParameterMap /rc_parameter_map" + "px4::msg::TelemetryStatus /telemetry_status" + "px4::msg::TimesyncStatus /timesync_status" + "px4::msg::UavcanParameterRequest /uavcan_parameter_request" # TODO: srv + "px4::msg::UavcanParameterValue /uavcan_parameter_value" # TODO: srv + "px4::msg::UlogStreamAck /ulog_stream_ack" # TODO: srv + + "px4::msg::InternalCombustionEngineStatus /internal_combustion_engine_status" # TODO: SITL + + # TODO: mavlink receiver + "px4::msg::CollisionReport /collision_report" + "px4::msg::VehicleOdometry /vehicle_visual_odometry" + "px4::msg::VehicleOdometry /vehicle_mocap_odometry" + "px4::msg::OffboardControlMode /offboard_control_mode" + "px4::msg::CameraStatus /camera_status" + "px4::msg::CellularStatus /cellular_status" + "px4::msg::FollowTarget /follow_target" + "px4::msg::GimbalManagerSetAttitude /gimbal_manager_set_attitude" + "px4::msg::GimbalManagerSetManualControl /gimbal_manager_set_manual_control" + "px4::msg::GimbalDeviceInformation /gimbal_device_information" + "px4::msg::LandingTargetPose /landing_target_pose" + "px4::msg::OnboardComputerStatus /onboard_computer_status" + "px4::msg::Ping /ping" + "px4::msg::GpsInjectData /gps_inject_data" + "px4::msg::RadioStatus /radio_status" + "px4::msg::TransponderReport /transponder_report" + "px4::msg::GeneratorStatus /generator_status" + "px4::msg::InputRc /input_rc" + "px4::msg::OpticalFlow /optical_flow" + "px4::msg::SensorGps /sensor_gps" + "px4::msg::VehicleOdometry /vehicle_odometry" + "px4::msg::ObstacleDistance /obstacle_distance" + "px4::msg::VehicleRatesSetpoint /vehicle_rates_setpoint" + + "px4::msg::DebugArray /debug_array" + "px4::msg::DebugKeyValue /debug_key_value" + "px4::msg::DebugValue /debug_value" + "px4::msg::DebugVect /debug_vect" + SUBSCRIPTIONS + "px4::msg::ActuatorOutputs /actuator_outputs" + "px4::msg::AutotuneAttitudeControlStatus /autotune_attitude_control_status" + "px4::msg::CameraCapture /camera_capture" + "px4::msg::CameraTrigger /camera_trigger" + "px4::msg::MountOrientation /mount_orientation" + "px4::msg::SensorHygrometer /sensor_hygrometer" + "px4::msg::SatelliteInfo /satellite_info" + "px4::msg::TecsStatus /tecs_status" + "px4::msg::VehicleAttitudeSetpoint /fw_virtual_attitude_setpoint" # VTOL + "px4::msg::VehicleAttitudeSetpoint /mc_virtual_attitude_setpoint" # VTOL + "px4::msg::GimbalDeviceAttitudeStatus /gimbal_device_attitude_status" + "px4::msg::GimbalDeviceSetAttitude /gimbal_device_set_attitude" + "px4::msg::GimbalManagerInformation /gimbal_manager_information" + "px4::msg::GimbalManagerStatus /gimbal_manager_status" + "px4::msg::VehicleAttitudeSetpoint /vehicle_attitude_setpoint" + "px4::msg::VehicleTrajectoryBezier /vehicle_trajectory_bezier" + "px4::msg::VehicleTrajectoryWaypoint /vehicle_trajectory_waypoint" + "px4::msg::VehicleTrajectoryWaypoint /vehicle_trajectory_waypoint_desired" + + "px4::msg::ObstacleDistance /obstacle_distance_fused" + "px4::msg::OrbitStatus /orbit_status" + "px4::msg::VehicleLocalPositionSetpoint /vehicle_local_position_setpoint" + + "px4::msg::VehicleAngularVelocity /vehicle_angular_velocity_groundtruth" + "px4::msg::VehicleAttitude /vehicle_attitude_groundtruth" + "px4::msg::VehicleGlobalPosition /vehicle_global_position_groundtruth" + "px4::msg::VehicleLocalPosition /vehicle_local_position_groundtruth" ) if(PX4_TESTING) diff --git a/src/modules/mc_att_control/CMakeLists.txt b/src/modules/mc_att_control/CMakeLists.txt index abd0f4ff9c..551478b5f7 100644 --- a/src/modules/mc_att_control/CMakeLists.txt +++ b/src/modules/mc_att_control/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2015-2019 PX4 Development Team. All rights reserved. +# Copyright (c) 2015-2021 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -36,6 +36,10 @@ add_subdirectory(AttitudeControl) px4_add_module( MODULE modules__mc_att_control MAIN mc_att_control + PUBLICATIONS + "px4::msg::VehicleAttitudeSetpoint /vehicle_attitude_setpoint" + "px4::msg::VehicleAttitudeSetpoint /mc_virtual_attitude_setpoint" # VTOL + "px4::msg::VehicleRatesSetpoint /vehicle_rates_setpoint" COMPILE_FLAGS ${MAX_CUSTOM_OPT_LEVEL} SRCS diff --git a/src/modules/mc_autotune_attitude_control/CMakeLists.txt b/src/modules/mc_autotune_attitude_control/CMakeLists.txt index 62dfc9ca3c..9600fd53ea 100644 --- a/src/modules/mc_autotune_attitude_control/CMakeLists.txt +++ b/src/modules/mc_autotune_attitude_control/CMakeLists.txt @@ -44,4 +44,6 @@ px4_add_module( mathlib px4_work_queue SystemIdentification + PUBLICATIONS + "px4::msg::AutotuneAttitudeControlStatus /autotune_attitude_control_status" ) diff --git a/src/modules/mc_hover_thrust_estimator/CMakeLists.txt b/src/modules/mc_hover_thrust_estimator/CMakeLists.txt index 9504a18add..848fbd05d4 100644 --- a/src/modules/mc_hover_thrust_estimator/CMakeLists.txt +++ b/src/modules/mc_hover_thrust_estimator/CMakeLists.txt @@ -49,6 +49,8 @@ px4_add_module( mathlib px4_work_queue zero_order_hover_thrust_ekf + PUBLICATIONS + "px4::msg::HoverThrustEstimate /hover_thrust_estimate" ) px4_add_unit_gtest(SRC zero_order_hover_thrust_ekf_test.cpp LINKLIBS zero_order_hover_thrust_ekf) diff --git a/src/modules/mc_pos_control/CMakeLists.txt b/src/modules/mc_pos_control/CMakeLists.txt index 49f61ac967..34f5d4e0a9 100644 --- a/src/modules/mc_pos_control/CMakeLists.txt +++ b/src/modules/mc_pos_control/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (c) 2015-2020 PX4 Development Team. All rights reserved. +# Copyright (c) 2015-2021 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -37,6 +37,11 @@ add_subdirectory(Takeoff) px4_add_module( MODULE modules__mc_pos_control MAIN mc_pos_control + PUBLICATIONS + "px4::msg::TakeoffStatus /takeoff_status" + "px4::msg::VehicleAttitudeSetpoint /vehicle_attitude_setpoint" + "px4::msg::VehicleAttitudeSetpoint /mc_virtual_attitude_setpoint" # VTOL + "px4::msg::VehicleLocalPositionSetpoint /vehicle_local_position_setpoint" COMPILE_FLAGS SRCS MulticopterPositionControl.cpp diff --git a/src/modules/mc_rate_control/CMakeLists.txt b/src/modules/mc_rate_control/CMakeLists.txt index 758d56b7c8..27fa84dbf0 100644 --- a/src/modules/mc_rate_control/CMakeLists.txt +++ b/src/modules/mc_rate_control/CMakeLists.txt @@ -36,6 +36,14 @@ add_subdirectory(RateControl) px4_add_module( MODULE modules__mc_rate_control MAIN mc_rate_control + PUBLICATIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::VehicleAttitudeSetpoint /actuator_controls_virtual_mc" # VTOL + "px4::msg::ActuatorControlsStatus /actuator_controls_status_0" + "px4::msg::RateCtrlStatus /rate_ctrl_status" + "px4::msg::VehicleRatesSetpoint /vehicle_rates_setpoint" + "px4::msg::VehicleTorqueSetpoint /vehicle_torque_setpoint" + "px4::msg::VehicleThrustSetpoint /vehicle_thrust_setpoint" COMPILE_FLAGS ${MAX_CUSTOM_OPT_LEVEL} SRCS diff --git a/src/modules/navigator/CMakeLists.txt b/src/modules/navigator/CMakeLists.txt index 7803826920..529146190d 100644 --- a/src/modules/navigator/CMakeLists.txt +++ b/src/modules/navigator/CMakeLists.txt @@ -55,4 +55,16 @@ px4_add_module( landing_slope geofence_breach_avoidance motion_planning + PUBLICATIONS + "px4::msg::GeofenceResult /geofence_result" + "px4::msg::MissionResult /mission_result" + "px4::msg::NavigatorMissionItem /navigator_mission_item" + "px4::msg::PositionSetpointTriplet /position_setpoint_triplet" + "px4::msg::RtlTimeEstimate /rtl_time_estimate" + "px4::msg::TransponderReport /transponder_report" + "px4::msg::VehicleRoi /vehicle_roi" + "px4::msg::ActuatorControls /actuator_controls_2" + SUBSCRIPTIONS + "px4::msg::PositionControllerStatus /position_controller_status" + "px4::msg::PositionControllerLandingStatus /position_controller_landing_status" ) diff --git a/src/modules/rc_update/CMakeLists.txt b/src/modules/rc_update/CMakeLists.txt index c6ba78dcce..5bb699591f 100644 --- a/src/modules/rc_update/CMakeLists.txt +++ b/src/modules/rc_update/CMakeLists.txt @@ -40,4 +40,9 @@ px4_add_module( DEPENDS mathlib px4_work_queue + PUBLICATIONS + "px4::msg::RcChannels /rc_channels" + "px4::msg::ManualControlSetpoint /manual_control_input" + "px4::msg::ManualControlSwitches /manual_control_switches" + "px4::msg::ActuatorControls /actuator_controls_3" ) diff --git a/src/modules/replay/Replay.hpp b/src/modules/replay/Replay.hpp index 94ecc9d416..7cf9401d95 100644 --- a/src/modules/replay/Replay.hpp +++ b/src/modules/replay/Replay.hpp @@ -42,7 +42,7 @@ #include "definitions.hpp" #include -#include +#include #include namespace px4 diff --git a/src/modules/rover_pos_control/CMakeLists.txt b/src/modules/rover_pos_control/CMakeLists.txt index 5e093862e7..3154d6c3d2 100644 --- a/src/modules/rover_pos_control/CMakeLists.txt +++ b/src/modules/rover_pos_control/CMakeLists.txt @@ -39,4 +39,10 @@ px4_add_module( DEPENDS l1 pid + PUBLICATIONS + "px4::msg::VehicleAttitudeSetpoint /vehicle_attitude_setpoint" + "px4::msg::PositionControllerStatus /position_controller_status" + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::VehicleTorqueSetpoint /vehicle_torque_setpoint" + "px4::msg::VehicleThrustSetpoint /vehicle_thrust_setpoint" ) diff --git a/src/modules/sensors/CMakeLists.txt b/src/modules/sensors/CMakeLists.txt index 0eb8a7e0a9..8dba86412c 100644 --- a/src/modules/sensors/CMakeLists.txt +++ b/src/modules/sensors/CMakeLists.txt @@ -62,4 +62,76 @@ px4_add_module( vehicle_gps_position vehicle_imu vehicle_magnetometer + PUBLICATIONS + "px4::msg::Airspeed /airspeed" + "px4::msg::SensorCombined /sensor_combined" + "px4::msg::SensorSelection /sensor_selection" + "px4::msg::SensorsStatusImu /sensors_status_imu" + "px4::msg::SensorPreflightMag /sensor_preflight_mag" + + "px4::msg::VehicleAcceleration /vehicle_acceleration" + "px4::msg::VehicleMagnetometer /vehicle_magnetometer" + "px4::msg::VehicleAirData /vehicle_air_data" + "px4::msg::VehicleImu /vehicle_imu" + "px4::msg::VehicleImuStatus /vehicle_imu_status" + "px4::msg::VehicleGpsPosition /vehicle_gps_position" + "px4::msg::VehicleAngularVelocity /vehicle_angular_velocity" + "px4::msg::VehicleAngularAcceleration /vehicle_angular_acceleration" + + # TODO: find a proper home + "px4::msg::IrlockReport /irlock_report" + "px4::msg::Rpm /rpm" + + SUBSCRIPTIONS + "px4::msg::SensorCorrection /sensor_correction" + + "px4::msg::SensorAccel /sensor_accel" # TODO + "px4::msg::SensorAccel /sensor_accel0" + "px4::msg::SensorAccel /sensor_accel1" + "px4::msg::SensorAccel /sensor_accel2" + "px4::msg::SensorAccel /sensor_accel3" + + "px4::msg::SensorAccelFifo /sensor_accel_fifo" + "px4::msg::SensorAccelFifo /sensor_accel_fifo0" + "px4::msg::SensorAccelFifo /sensor_accel_fifo1" + "px4::msg::SensorAccelFifo /sensor_accel_fifo2" + "px4::msg::SensorAccelFifo /sensor_accel_fifo3" + + "px4::msg::SensorGyro /sensor_gyro" + "px4::msg::SensorGyro /sensor_gyro0" + "px4::msg::SensorGyro /sensor_gyro1" + "px4::msg::SensorGyro /sensor_gyro2" + "px4::msg::SensorGyro /sensor_gyro3" + + "px4::msg::SensorGyroFifo /sensor_gyro_fifo" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo0" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo1" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo2" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo3" + + "px4::msg::SensorGyroFft /sensor_gyro_fft" + + "px4::msg::DistanceSensor /distance_sensor" # TODO + + # vehicle_angular_velocity + "px4::msg::EstimatorSelectorStatus /estimator_selector_status" + "px4::msg::EstimatorSensorBias /estimator_sensor_bias" + "px4::msg::EscStatus /esc_status" + "px4::msg::VehicleControlMode /vehicle_control_mode" + + # vehicle_air_data + "px4::msg::SensorBaro /sensor_baro" # TODO + "px4::msg::SensorBaro /sensor_baro0" + "px4::msg::SensorBaro /sensor_baro1" + "px4::msg::SensorBaro /sensor_baro2" + "px4::msg::SensorBaro /sensor_baro3" + + # vehicle_magnetometer + "px4::msg::SensorMag /sensor_mag" # TODO + "px4::msg::SensorMag /sensor_mag0" + "px4::msg::SensorMag /sensor_mag1" + "px4::msg::SensorMag /sensor_mag2" + "px4::msg::SensorMag /sensor_mag3" + "px4::msg::MagnetometerBiasEstimate /magnetometer_bias_estimate" + "px4::msg::ActuatorControls /actuator_controls_0" ) diff --git a/src/modules/sih/CMakeLists.txt b/src/modules/sih/CMakeLists.txt index bb103d089f..a6436cab73 100644 --- a/src/modules/sih/CMakeLists.txt +++ b/src/modules/sih/CMakeLists.txt @@ -47,4 +47,9 @@ px4_add_module( drivers_gyroscope drivers_magnetometer px4_work_queue + PUBLICATIONS + "px4::msg::VehicleAngularVelocity /vehicle_angular_velocity_groundtruth" + "px4::msg::VehicleAttitude /vehicle_attitude_groundtruth" + "px4::msg::VehicleGlobalPosition /vehicle_global_position_groundtruth" + "px4::msg::VehicleLocalPosition /vehicle_local_position_groundtruth" ) diff --git a/src/modules/simulator/CMakeLists.txt b/src/modules/simulator/CMakeLists.txt index 66a0ce3a05..552850593c 100644 --- a/src/modules/simulator/CMakeLists.txt +++ b/src/modules/simulator/CMakeLists.txt @@ -68,6 +68,26 @@ px4_add_module( drivers_barometer drivers_gyroscope drivers_magnetometer + PUBLICATIONS + "px4::msg::VehicleOdometry /vehicle_visual_odometry" + "px4::msg::VehicleAngularVelocity /vehicle_angular_velocity_groundtruth" + "px4::msg::VehicleAttitude /vehicle_attitude_groundtruth" + "px4::msg::VehicleGlobalPosition /vehicle_global_position_groundtruth" + "px4::msg::VehicleLocalPosition /vehicle_local_position_groundtruth" + + "px4::msg::InputRc /input_rc" + + "px4::msg::DistanceSensor /distance_sensor" + "px4::msg::DifferentialPressure /differential_pressure" + "px4::msg::OpticalFlow /optical_flow" + "px4::msg::IrlockReport /irlock_report" + "px4::msg::SensorBaro /sensor_baro" + "px4::msg::SensorGps /sensor_gps" + "px4::msg::SensorMag /sensor_mag" + "px4::msg::SensorAccel /sensor_accel" + "px4::msg::SensorGyro /sensor_gyro" + "px4::msg::SensorAccelFifo /sensor_accel_fifo" + "px4::msg::SensorGyroFifo /sensor_gyro_fifo" ) target_include_directories(modules__simulator INTERFACE ${CMAKE_BINARY_DIR}/mavlink) diff --git a/src/modules/simulator/battery_simulator/CMakeLists.txt b/src/modules/simulator/battery_simulator/CMakeLists.txt index c4ba81329e..04cba6559c 100644 --- a/src/modules/simulator/battery_simulator/CMakeLists.txt +++ b/src/modules/simulator/battery_simulator/CMakeLists.txt @@ -42,4 +42,6 @@ px4_add_module( battery mathlib px4_work_queue + PUBLICATIONS + "px4::msg::BatteryStatus /battery_status" ) diff --git a/src/modules/temperature_compensation/CMakeLists.txt b/src/modules/temperature_compensation/CMakeLists.txt index 50e6a181e0..b32e05ded4 100644 --- a/src/modules/temperature_compensation/CMakeLists.txt +++ b/src/modules/temperature_compensation/CMakeLists.txt @@ -43,4 +43,7 @@ px4_add_module( temperature_calibration/task.cpp DEPENDS mathlib + PUBLICATIONS + "px4::msg::SensorCorrection /sensor_correction" + "px4::msg::LedControl /led_control" ) diff --git a/src/modules/uuv_att_control/CMakeLists.txt b/src/modules/uuv_att_control/CMakeLists.txt index 37dc0d728c..820896e696 100644 --- a/src/modules/uuv_att_control/CMakeLists.txt +++ b/src/modules/uuv_att_control/CMakeLists.txt @@ -37,4 +37,7 @@ px4_add_module( COMPILE_FLAGS SRCS uuv_att_control.cpp + PUBLICATIONS + "px4::msg::VehicleTorqueSetpoint /vehicle_torque_setpoint" + "px4::msg::VehicleThrustSetpoint /vehicle_thrust_setpoint" ) diff --git a/src/modules/vmount/CMakeLists.txt b/src/modules/vmount/CMakeLists.txt index a24e2141a7..cf0725fba3 100644 --- a/src/modules/vmount/CMakeLists.txt +++ b/src/modules/vmount/CMakeLists.txt @@ -45,5 +45,11 @@ px4_add_module( vmount.cpp DEPENDS geo + PUBLICATIONS + "px4::msg::GimbalManagerInformation /gimbal_manager_information" + "px4::msg::GimbalManagerStatus /gimbal_manager_status" + "px4::msg::GimbalDeviceSetAttitude /gimbal_device_set_attitude" + "px4::msg::GimbalDeviceAttitudeStatus /gimbal_device_attitude_status" + "px4::msg::MountOrientation /mount_orientation" ) diff --git a/src/modules/vtol_att_control/CMakeLists.txt b/src/modules/vtol_att_control/CMakeLists.txt index e6316b1459..aa1d64b3c7 100644 --- a/src/modules/vtol_att_control/CMakeLists.txt +++ b/src/modules/vtol_att_control/CMakeLists.txt @@ -39,5 +39,12 @@ px4_add_module( vtol_type.cpp tailsitter.cpp standard.cpp + PUBLICATIONS + "px4::msg::ActuatorControls /actuator_controls_0" + "px4::msg::ActuatorControls /actuator_controls_1" + "px4::msg::VtolVehicleStatus /vtol_vehicle_status" + "px4::msg::VehicleAttitudeSetpoint /vehicle_attitude_setpoint" + "px4::msg::VehicleTorqueSetpoint /vehicle_torque_setpoint" + "px4::msg::VehicleThrustSetpoint /vehicle_thrust_setpoint" ) diff --git a/src/systemcmds/topic_listener/generate_listener.py b/src/systemcmds/topic_listener/generate_listener.py new file mode 100755 index 0000000000..2edcbb91e9 --- /dev/null +++ b/src/systemcmds/topic_listener/generate_listener.py @@ -0,0 +1,140 @@ +#!/usr/bin/python + +import glob +import os +import sys +import re + +# This script is run from Build/_default.build/$(PX4_BASE)/Firmware/src/systemcmds/topic_listener + +# argv[1] must be the full path of the top Firmware dir +# argv[2] - argv[n] is the full list of msg files + +raw_messages = sys.argv[2:] + +messages = [] +topics = [] +message_elements = [] + +for index,m in enumerate(raw_messages): + topic_list = [] + + msg_path = sys.argv[1]+ '/msg/' + m + + if os.path.isfile(msg_path): + # first try opening file in msg/ directory + f = open(msg_path,'r') + else: + # otherwise try opening directly (could be an external module msg) + f = open(m,'r') + + for line in f.readlines(): + items = re.split('\s+', line.strip()) + + if '# TOPICS' == ' '.join(items[:2]): + for topic in items[2:]: + topic_list.append(topic) + + f.close() + + (m_head, m_tail) = os.path.split(m) + message = m_tail.split('.')[0] + + messages.append(message) + + for topic in topic_list: + topics.append(topic) + + if len(topic_list) == 0: + # topic name PascalCase (file name) to snake_case (topic name) + topic_name = re.sub(r'(? +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +""") +for m in set(messages): + msg_header_file = re.sub(r'(?" % msg_header_file) + +print (""" +\nvoid listener_generated(char * topic_name, int topic_instance, int topic_rate, int num_msgs) { +""") + +print(""" + unsigned topic_interval = 0; + if (topic_rate != 0) { + topic_interval = 1000 / topic_rate; + } +""") + +for index, (m, t) in enumerate(zip(messages, topics)): + if index == 0: + print("\tif (strcmp(topic_name,\"%s\") == 0) {" % (t)) + else: + print("\t} else if (strcmp(topic_name,\"%s\") == 0) {" % (t)) + print("\t\tlistener(listener_print_topic, ORB_ID(%s), num_msgs, topic_instance, topic_interval);" % (m, t)) + +print("\t} else {") +print("\t\t PX4_INFO_RAW(\" Topic did not match any known topics\\n\");") +print("\t}") + +print("}\n") diff --git a/src/systemcmds/topic_listener/listener_main.cpp b/src/systemcmds/topic_listener/listener_main.cpp index b4db038c12..8c67c775a2 100644 --- a/src/systemcmds/topic_listener/listener_main.cpp +++ b/src/systemcmds/topic_listener/listener_main.cpp @@ -42,7 +42,7 @@ #include -#include +#include #include "topic_listener.hpp" // Amount of time to wait when listening for a message, before giving up. diff --git a/uORBTopics.cpp.in b/uORBTopics.cpp.in new file mode 100644 index 0000000000..3dd783e5d3 --- /dev/null +++ b/uORBTopics.cpp.in @@ -0,0 +1,56 @@ +/**************************************************************************** + * + * Copyright (C) 2021 PX4 Development Team. All rights reserved. + * + * 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. + * + ****************************************************************************/ + +#include + +#include "uORBTopics.hpp" + +@PX4_ORB_DEFINE_STR@ + +const constexpr struct orb_metadata *const uorb_topics_list[ORB_TOPICS_COUNT] = { +@PX4_MSG_TOPIC_ORB_ID@ +}; + +const struct orb_metadata *const *orb_get_topics() +{ + return uorb_topics_list; +} + +const struct orb_metadata *get_orb_meta(ORB_ID id) +{ + if (id == ORB_ID::INVALID) { + return nullptr; + } + + return uorb_topics_list[static_cast(id)]; +} diff --git a/msg/templates/px4/ros/msg.h.em b/uORBTopics.hpp.in similarity index 57% rename from msg/templates/px4/ros/msg.h.em rename to uORBTopics.hpp.in index e102a087d4..e3702eab68 100644 --- a/msg/templates/px4/ros/msg.h.em +++ b/uORBTopics.hpp.in @@ -1,23 +1,6 @@ -@############################################### -@# -@# PX4 ROS compatible message source code -@# generation for C++ -@# -@# This file generates the multiplatform wrapper -@# -@# EmPy template for generating .h files -@# Based on the original template for ROS -@# -@############################################### -@# Start of Template -@# -@# Context: -@# - file_name_in (String) Source file -@# - spec (msggen.MsgSpec) Parsed specification of the .msg file -@############################################### /**************************************************************************** * - * Copyright (C) 2013-2015 PX4 Development Team. All rights reserved. + * Copyright (C) 2021 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -48,47 +31,42 @@ * ****************************************************************************/ -/* Auto-generated by genmsg_cpp from file @file_name_in */ - -@{ -import genmsg.msgs - - -cpp_class = 'px4_%s'%spec.short_name -native_type = spec.short_name -topic_name = spec.short_name -}@ #pragma once -@############################## -@# Generic Includes -@############################## -#include "px4/@(topic_name).h" -#include "platforms/px4_message.h" +#include -@############################## -@# Class -@############################## +#include -namespace px4 -{ -class @(cpp_class) : - public PX4Message<@(native_type)> -{ -public: - @(cpp_class)() : - PX4Message<@(native_type)>() - {} +@PX4_ORB_HEADER_INCLUDE_STR@ - @(cpp_class)(@(native_type) msg) : - PX4Message<@(native_type)>(msg) - {} +static constexpr size_t ORB_TOPICS_COUNT{@PX4_ORB_TOPIC_COUNT@}; +static constexpr size_t orb_topics_count() { return ORB_TOPICS_COUNT; } - ~@(cpp_class)() {} +@PX4_ORB_DECLARE_STR@ - static PX4TopicHandle handle() {return "@(topic_name)";} +/* + * Returns array of topics metadata + */ +extern const struct orb_metadata *const *orb_get_topics() __EXPORT; + +enum class ORB_ID : uint8_t { +@PX4_MSG_TOPIC_ID@ + + INVALID }; -}; +const struct orb_metadata *get_orb_meta(ORB_ID id); + + +static constexpr const char *get_topic_string(ORB_ID orb_id) +{ + switch (orb_id) { +@PX4_MSG_TOPIC_ID_STRING@ + default: + return nullptr; + } + + return nullptr; +}