diff --git a/AntennaTracker/ReleaseNotes.txt b/AntennaTracker/ReleaseNotes.txt index 8dc637d1a0..9a15d2f06b 100644 --- a/AntennaTracker/ReleaseNotes.txt +++ b/AntennaTracker/ReleaseNotes.txt @@ -91,6 +91,71 @@ Changes from 4.5.5 ------------------------------------------------------------------ Release 4.5.5 1st Aug 2024 +No changes from 4.5.5-beta2 +------------------------------------------------------------------ +Release 4.5.7 08 Oct 2024 + +Changes from 4.5.7-beta1 + +1) Reverted Septentrio GPS sat count correctly drops to zero when 255 received +------------------------------------------------------------------ +Release 4.5.7-beta1 26 Sep 2024 + +Changes from 4.5.6 + +1) Bug fixes and minor enhancements + +- VUAV-V7pro support +- CUAV-7-Nano correction for LEDs and battery volt and current scaling +- DroneCAN deadlock and saturation of CAN bus fixed +- DroneCAN DNA server init fix (caused logging issues and spam on bus) +- F4 boards with inverter support correctly uninvert RX/TX +- Nanoradar M72 radar driver fix for object avoidance path planning +- RC support for latest version of GHST +- Septentrio GPS sat count correctly drops to zero when 255 received + +2) ROS2/DDS and other developer focused enhancements + +- AP quaternions normalised for ROS2 to avoid warnings +- Dependencies fixed for easier installation +- ROS2 SITL launch file enhancements including displaying console and map +- ROS_DOMAIN_ID param added to support multiple vehicles or instances of ROS2 +- Python 3.12 support +------------------------------------------------------------------ +Release 4.5.6 03 Sep 2024 + +No changes from 4.5.6-beta1 +------------------------------------------------------------------ +Release 4.5.6-beta1 20 Aug 2024 + +Changes from 4.5.5 + +1) Board specific enhancements and bug fixes + +- 3DR Control Zero H7 Rev G support +- CUAV-7-Nano support +- FoxeerF405v2 servo outputs increased from 9 to 11 +- Holybro Pixhawk6C hi-power peripheral overcurrent reporting fixed +- iFlight 2RAW H7 support +- MFT-SEMA100 support +- TMotorH743 support BMI270 baro +- ZeroOneX6 support + +2) Minor enhancements and bug fixes + +- Cameras using MAVLink report vendor and model name correctly +- DroneCAN fix to remove occasional NodeID registration error +- GPS NMEA and GSoF driver ground course corrected (now always 0 ~ 360 deg) +- ICP101XX barometer slowed to avoid I2C communication errors +- IMU temp cal param (INSn_ACCSCAL_Z) stored correctly when bootloader is flashed +- IMU gyro/accel duplicate id registration fixed to avoid possible pre-arm failure +- Logging to flash timestamp fix +- OSD displays ESC temp instead of motor temp +- PID controller error calculation bug fix (was using target from prev iteration) +- Relay on MAIN pins fixed +------------------------------------------------------------------ +Release 4.5.5 1st Aug 2024 + No changes from 4.5.5-beta2 ------------------------------------------------------------------ Release 4.5.5-beta2 27 July 2024 @@ -241,6 +306,10 @@ No changes from 4.5.0-beta4 ------------------------------------------------------------------ Release 4.5.0 2nd April 2024 +No changes from 4.5.0-beta4 +------------------------------------------------------------------ +Release 4.5.0 2nd April 2024 + No changes from 4.5.0-beta4 ------------------------------------------------------------------ Release 4.5.0-beta4 22nd March 2024 diff --git a/AntennaTracker/version.h b/AntennaTracker/version.h index 962137e0d0..527a6e9d24 100644 --- a/AntennaTracker/version.h +++ b/AntennaTracker/version.h @@ -6,14 +6,14 @@ #include "ap_version.h" -#define THISFIRMWARE "AntennaTracker V4.5.6" +#define THISFIRMWARE "AntennaTracker V4.5.7" // the following line is parsed by the autotest scripts -#define FIRMWARE_VERSION 4,5,6,FIRMWARE_VERSION_TYPE_OFFICIAL +#define FIRMWARE_VERSION 4,5,7,FIRMWARE_VERSION_TYPE_OFFICIAL #define FW_MAJOR 4 #define FW_MINOR 5 -#define FW_PATCH 6 +#define FW_PATCH 7 #define FW_TYPE FIRMWARE_VERSION_TYPE_OFFICIAL #include diff --git a/ArduCopter/ReleaseNotes.txt b/ArduCopter/ReleaseNotes.txt index ed3bf0ea1a..360f033f1e 100644 --- a/ArduCopter/ReleaseNotes.txt +++ b/ArduCopter/ReleaseNotes.txt @@ -1,5 +1,35 @@ ArduPilot Copter Release Notes: ------------------------------------------------------------------ +Release 4.5.7 08 Oct 2024 + +Changes from 4.5.7-beta1 + +1) Reverted Septentrio GPS sat count correctly drops to zero when 255 received +------------------------------------------------------------------ +Release 4.5.7-beta1 26 Sep 2024 + +Changes from 4.5.6 + +1) Bug fixes and minor enhancements + +- VUAV-V7pro support +- CUAV-7-Nano correction for LEDs and battery volt and current scaling +- DroneCAN deadlock and saturation of CAN bus fixed +- DroneCAN DNA server init fix (caused logging issues and spam on bus) +- F4 boards with inverter support correctly uninvert RX/TX +- Nanoradar M72 radar driver fix for object avoidance path planning +- RC support for latest version of GHST +- Septentrio GPS sat count correctly drops to zero when 255 received +- TradHeli DDVP tail rotor pitch actuator fixed + +2) ROS2/DDS and other developer focused enhancements + +- AP quaternions normalised for ROS2 to avoid warnings +- Dependencies fixed for easier installation +- ROS2 SITL launch file enhancements including displaying console and map +- ROS_DOMAIN_ID param added to support multiple vehicles or instances of ROS2 +- Python 3.12 support +------------------------------------------------------------------ Release 4.5.6 03 Sep 2024 No changes from 4.5.6-beta1 diff --git a/ArduCopter/version.h b/ArduCopter/version.h index 8a12e4d835..0148d480c4 100644 --- a/ArduCopter/version.h +++ b/ArduCopter/version.h @@ -6,14 +6,14 @@ #include "ap_version.h" -#define THISFIRMWARE "ArduCopter V4.5.6" +#define THISFIRMWARE "ArduCopter V4.5.7" // the following line is parsed by the autotest scripts -#define FIRMWARE_VERSION 4,5,6,FIRMWARE_VERSION_TYPE_OFFICIAL +#define FIRMWARE_VERSION 4,5,7,FIRMWARE_VERSION_TYPE_OFFICIAL #define FW_MAJOR 4 #define FW_MINOR 5 -#define FW_PATCH 6 +#define FW_PATCH 7 #define FW_TYPE FIRMWARE_VERSION_TYPE_OFFICIAL #include diff --git a/ArduPlane/ReleaseNotes.txt b/ArduPlane/ReleaseNotes.txt index 2f2827aef8..e8699fa5c9 100644 --- a/ArduPlane/ReleaseNotes.txt +++ b/ArduPlane/ReleaseNotes.txt @@ -1,5 +1,35 @@ ArduPilot Plane Release Notes: ------------------------------------------------------------------ +Release 4.5.7 08 Oct 2024 + +Changes from 4.5.7-beta1 + +1) Reverted Septentrio GPS sat count correctly drops to zero when 255 received +------------------------------------------------------------------ +Release 4.5.7-beta1 26 Sep 2024 + +Changes from 4.5.6 + +1) Bug fixes and minor enhancements + +- VUAV-V7pro support +- CUAV-7-Nano correction for LEDs and battery volt and current scaling +- DroneCAN deadlock and saturation of CAN bus fixed +- DroneCAN DNA server init fix (caused logging issues and spam on bus) +- F4 boards with inverter support correctly uninvert RX/TX +- Nanoradar M72 radar driver fix for object avoidance path planning +- Plane fix to ability to disable the takeoff atititude checks +- RC support for latest version of GHST +- Septentrio GPS sat count correctly drops to zero when 255 received + +2) ROS2/DDS and other developer focused enhancements + +- AP quaternions normalised for ROS2 to avoid warnings +- Dependencies fixed for easier installation +- ROS2 SITL launch file enhancements including displaying console and map +- ROS_DOMAIN_ID param added to support multiple vehicles or instances of ROS2 +- Python 3.12 support +------------------------------------------------------------------ Release 4.5.6 03 Sep 2024 No changes from 4.5.6-beta1 diff --git a/ArduPlane/takeoff.cpp b/ArduPlane/takeoff.cpp index 5d8a428d34..b856505aee 100644 --- a/ArduPlane/takeoff.cpp +++ b/ArduPlane/takeoff.cpp @@ -57,7 +57,7 @@ bool Plane::auto_takeoff_check(void) bool do_takeoff_attitude_check = !(flight_option_enabled(FlightOptions::DISABLE_TOFF_ATTITUDE_CHK)); #if HAL_QUADPLANE_ENABLED // disable attitude check on tailsitters - do_takeoff_attitude_check = !quadplane.tailsitter.enabled(); + do_takeoff_attitude_check &= !quadplane.tailsitter.enabled(); #endif if (!takeoff_state.launchTimerStarted && !is_zero(g.takeoff_throttle_min_accel)) { diff --git a/ArduPlane/version.h b/ArduPlane/version.h index c5a10de301..84d72a347e 100644 --- a/ArduPlane/version.h +++ b/ArduPlane/version.h @@ -6,14 +6,14 @@ #include "ap_version.h" -#define THISFIRMWARE "ArduPlane V4.5.6" +#define THISFIRMWARE "ArduPlane V4.5.7" // the following line is parsed by the autotest scripts -#define FIRMWARE_VERSION 4,5,6,FIRMWARE_VERSION_TYPE_OFFICIAL +#define FIRMWARE_VERSION 4,5,7,FIRMWARE_VERSION_TYPE_OFFICIAL #define FW_MAJOR 4 #define FW_MINOR 5 -#define FW_PATCH 6 +#define FW_PATCH 7 #define FW_TYPE FIRMWARE_VERSION_TYPE_OFFICIAL #include diff --git a/Rover/ReleaseNotes.txt b/Rover/ReleaseNotes.txt index 7ade5052c0..792f86077d 100644 --- a/Rover/ReleaseNotes.txt +++ b/Rover/ReleaseNotes.txt @@ -1,5 +1,34 @@ Rover Release Notes: ------------------------------------------------------------------ +Release 4.5.7 08 Oct 2024 + +Changes from 4.5.7-beta1 + +1) Reverted Septentrio GPS sat count correctly drops to zero when 255 received +------------------------------------------------------------------ +Release 4.5.7-beta1 26 Sep 2024 + +Changes from 4.5.6 + +1) Bug fixes and minor enhancements + +- VUAV-V7pro support +- CUAV-7-Nano correction for LEDs and battery volt and current scaling +- DroneCAN deadlock and saturation of CAN bus fixed +- DroneCAN DNA server init fix (caused logging issues and spam on bus) +- F4 boards with inverter support correctly uninvert RX/TX +- Nanoradar M72 radar driver fix for object avoidance path planning +- RC support for latest version of GHST +- Septentrio GPS sat count correctly drops to zero when 255 received + +2) ROS2/DDS and other developer focused enhancements + +- AP quaternions normalised for ROS2 to avoid warnings +- Dependencies fixed for easier installation +- ROS2 SITL launch file enhancements including displaying console and map +- ROS_DOMAIN_ID param added to support multiple vehicles or instances of ROS2 +- Python 3.12 support +------------------------------------------------------------------ Release 4.5.6 03 Sep 2024 No changes from 4.5.6-beta1 diff --git a/Rover/version.h b/Rover/version.h index b329eb2a22..e0ecdbc9f1 100644 --- a/Rover/version.h +++ b/Rover/version.h @@ -6,14 +6,14 @@ #include "ap_version.h" -#define THISFIRMWARE "ArduRover V4.5.6" +#define THISFIRMWARE "ArduRover V4.5.7" // the following line is parsed by the autotest scripts -#define FIRMWARE_VERSION 4,5,6,FIRMWARE_VERSION_TYPE_OFFICIAL +#define FIRMWARE_VERSION 4,5,7,FIRMWARE_VERSION_TYPE_OFFICIAL #define FW_MAJOR 4 #define FW_MINOR 5 -#define FW_PATCH 6 +#define FW_PATCH 7 #define FW_TYPE FIRMWARE_VERSION_TYPE_OFFICIAL #include diff --git a/Tools/ardupilotwaf/ap_library.py b/Tools/ardupilotwaf/ap_library.py index b49010ae06..188fe6146d 100644 --- a/Tools/ardupilotwaf/ap_library.py +++ b/Tools/ardupilotwaf/ap_library.py @@ -206,6 +206,8 @@ def scan(self): # force dependency scan, if necessary self.compiled_task.signature() + if not self.compiled_task.uid() in self.generator.bld.node_deps: + return r, [] for n in self.generator.bld.node_deps[self.compiled_task.uid()]: # using common Node methods doesn't work here p = n.abspath() diff --git a/Tools/ardupilotwaf/chibios.py b/Tools/ardupilotwaf/chibios.py index e238e3b24a..a39b5cb566 100644 --- a/Tools/ardupilotwaf/chibios.py +++ b/Tools/ardupilotwaf/chibios.py @@ -18,7 +18,11 @@ _dynamic_env_data = {} def _load_dynamic_env_data(bld): bldnode = bld.bldnode.make_node('modules/ChibiOS') - tmp_str = bldnode.find_node('include_dirs').read() + include_dirs_node = bldnode.find_node('include_dirs') + if include_dirs_node is None: + _dynamic_env_data['include_dirs'] = [] + return + tmp_str = include_dirs_node.read() tmp_str = tmp_str.replace(';\n','') tmp_str = tmp_str.replace('-I','') #remove existing -I flags # split, coping with separator diff --git a/Tools/ardupilotwaf/git_submodule.py b/Tools/ardupilotwaf/git_submodule.py index be28216e9c..e2c727e05b 100644 --- a/Tools/ardupilotwaf/git_submodule.py +++ b/Tools/ardupilotwaf/git_submodule.py @@ -91,7 +91,7 @@ def runnable_status(self): else: r = Task.RUN_ME - if self.non_fast_forward: + if getattr(self,'non_fast_forward',[]): r = Task.SKIP_ME return r @@ -148,7 +148,7 @@ def git_submodule(bld, git_submodule, **kw): def _post_fun(bld): Logs.info('') for name, t in _submodules_tasks.items(): - if not t.non_fast_forward: + if not getattr(t,'non_fast_forward',[]): continue Logs.warn("Submodule %s not updated: non-fastforward" % name) diff --git a/Tools/bootloaders/VUAV-V7pro_bl.bin b/Tools/bootloaders/VUAV-V7pro_bl.bin new file mode 100755 index 0000000000..494ce9afa8 Binary files /dev/null and b/Tools/bootloaders/VUAV-V7pro_bl.bin differ diff --git a/Tools/ros2/README.md b/Tools/ros2/README.md index 9832e412f9..d847eeea3a 100644 --- a/Tools/ros2/README.md +++ b/Tools/ros2/README.md @@ -1,18 +1,34 @@ # ArduPilot ROS 2 packages - This directory contains ROS 2 packages and configuration files for running - ROS 2 processes and nodes that communicate with the ArduPilot DDS client - library using the microROS agent. It contains the following packages: +This directory contains ROS 2 packages and configuration files for running +ROS 2 processes and nodes that communicate with the ArduPilot DDS client +library using the microROS agent. It contains the following packages: #### `ardupilot_sitl` -A `colcon` package for building and running ArduPilot SITL using the ROS 2 CLI. +This is a `colcon` package for building and running ArduPilot SITL using the ROS 2 CLI. For example `ardurover` SITL may be launched with: ```bash ros2 launch ardupilot_sitl sitl.launch.py command:=ardurover model:=rover ``` +Other launch files are included with many arguments. +Some common arguments are exposed and forwarded to the underlying process. + +For example, MAVProxy can be launched, and you can enable the `console` and `map`. +```bash +ros2 launch ardupilot_sitl sitl_mavproxy.launch.py map:=True console:=True +``` + +ArduPilot SITL does not yet expose all arguments from the underlying binary. +See [#27714](https://github.com/ArduPilot/ardupilot/issues/27714) for context. + +To see all current options, use the `-s` argument: +```bash +ros2 launch ardupilot_sitl sitl.launch.py -s +``` + #### `ardupilot_dds_test` A `colcon` package for testing communication between `micro_ros_agent` and the diff --git a/Tools/ros2/ardupilot_dds_tests/package.xml b/Tools/ros2/ardupilot_dds_tests/package.xml index b4cc9fa2a0..528f4794a1 100644 --- a/Tools/ros2/ardupilot_dds_tests/package.xml +++ b/Tools/ros2/ardupilot_dds_tests/package.xml @@ -27,12 +27,15 @@ ament_lint_auto ardupilot_msgs ardupilot_sitl + builtin_interfaces launch launch_pytest launch_ros micro_ros_msgs python3-pytest rclpy + sensor_msgs + ament_python diff --git a/Tools/ros2/ardupilot_sitl/CMakeLists.txt b/Tools/ros2/ardupilot_sitl/CMakeLists.txt index 4b50d602da..628623f608 100644 --- a/Tools/ros2/ardupilot_sitl/CMakeLists.txt +++ b/Tools/ros2/ardupilot_sitl/CMakeLists.txt @@ -79,6 +79,12 @@ install(DIRECTORY DESTINATION share/${PROJECT_NAME}/config/ ) +# Install additional autotest model params. +install(DIRECTORY + ${ARDUPILOT_ROOT}/Tools/autotest/models + DESTINATION share/${PROJECT_NAME}/config/ +) + # Install Python package. ament_python_install_package(${PROJECT_NAME} PACKAGE_DIR src/${PROJECT_NAME} diff --git a/Tools/ros2/ardupilot_sitl/package.xml b/Tools/ros2/ardupilot_sitl/package.xml index 5cc0abfd72..fd1cc359ed 100644 --- a/Tools/ros2/ardupilot_sitl/package.xml +++ b/Tools/ros2/ardupilot_sitl/package.xml @@ -11,7 +11,15 @@ ament_cmake ament_cmake_python + ardupilot_msgs + builtin_interfaces + geographic_msgs + geometry_msgs micro_ros_agent + rosgraph_msgs + sensor_msgs + std_msgs + tf2_msgs ament_lint_auto ament_cmake_black diff --git a/Tools/ros2/ardupilot_sitl/src/ardupilot_sitl/launch.py b/Tools/ros2/ardupilot_sitl/src/ardupilot_sitl/launch.py index 6578e537d8..12b7009df9 100644 --- a/Tools/ros2/ardupilot_sitl/src/ardupilot_sitl/launch.py +++ b/Tools/ros2/ardupilot_sitl/src/ardupilot_sitl/launch.py @@ -31,6 +31,9 @@ from .actions import ExecuteFunction +TRUE_STRING = "True" +FALSE_STRING = "False" +BOOL_STRING_CHOICES = set([TRUE_STRING, FALSE_STRING]) class VirtualPortsLaunch: """Launch functions for creating virtual ports using `socat`.""" @@ -284,28 +287,38 @@ def generate_action(context: LaunchContext, *args, **kwargs) -> ExecuteProcess: # Retrieve launch arguments. master = LaunchConfiguration("master").perform(context) - # out = LaunchConfiguration("out").perform(context) + out = LaunchConfiguration("out").perform(context) sitl = LaunchConfiguration("sitl").perform(context) + console = LaunchConfiguration("console").perform(context) + map = LaunchConfiguration("map").perform(context) # Display launch arguments. print(f"command: {command}") print(f"master: {master}") print(f"sitl: {sitl}") + print(f"out: {out}") + print(f"console: {console}") + print(f"map: {map}") + + cmd = [ + f"{command} ", + f"--out {out} ", + "--out ", + "127.0.0.1:14551 ", + f"--master {master} ", + f"--sitl {sitl} ", + "--non-interactive ", + ] + + if console == TRUE_STRING: + cmd.append("--console ") + + if map == TRUE_STRING: + cmd.append("--map ") # Create action. mavproxy_process = ExecuteProcess( - cmd=[ - [ - f"{command} ", - "--out ", - "127.0.0.1:14550 ", - "--out ", - "127.0.0.1:14551 ", - f"--master {master} ", - f"--sitl {sitl} ", - "--non-interactive ", - ] - ], + cmd=cmd, shell=True, output="both", respawn=False, @@ -355,6 +368,18 @@ def generate_launch_arguments() -> List[DeclareLaunchArgument]: default_value="127.0.0.1:5501", description="SITL output port.", ), + DeclareLaunchArgument( + "map", + default_value="False", + description="Enable MAVProxy Map.", + choices=BOOL_STRING_CHOICES + ), + DeclareLaunchArgument( + "console", + default_value="False", + description="Enable MAVProxy Console.", + choices=BOOL_STRING_CHOICES + ), ] @@ -399,12 +424,12 @@ def generate_action(context: LaunchContext, *args, **kwargs) -> ExecuteProcess: # Optional arguments. wipe = LaunchConfiguration("wipe").perform(context) - if wipe == "True": + if wipe == TRUE_STRING: cmd_args.append("--wipe ") print(f"wipe: {wipe}") synthetic_clock = LaunchConfiguration("synthetic_clock").perform(context) - if synthetic_clock == "True": + if synthetic_clock == TRUE_STRING: cmd_args.append("--synthetic-clock ") print(f"synthetic_clock: {synthetic_clock}") @@ -566,13 +591,13 @@ def generate_launch_arguments() -> List[DeclareLaunchArgument]: "wipe", default_value="False", description="Wipe eeprom.", - choices=["True", "False"], + choices=BOOL_STRING_CHOICES, ), DeclareLaunchArgument( "synthetic_clock", default_value="False", description="Set synthetic clock mode.", - choices=["True", "False"], + choices=BOOL_STRING_CHOICES, ), DeclareLaunchArgument( "home", diff --git a/libraries/AP_DDS/AP_DDS_Client.cpp b/libraries/AP_DDS/AP_DDS_Client.cpp index 3daa69f6b8..6d7902f3e4 100644 --- a/libraries/AP_DDS/AP_DDS_Client.cpp +++ b/libraries/AP_DDS/AP_DDS_Client.cpp @@ -72,9 +72,25 @@ const AP_Param::GroupInfo AP_DDS_Client::var_info[] { #endif + // @Param: _DOMAIN_ID + // @DisplayName: DDS DOMAIN ID + // @Description: Set the ROS_DOMAIN_ID + // @Range: 0 232 + // @RebootRequired: True + // @User: Standard + AP_GROUPINFO("_DOMAIN_ID", 4, AP_DDS_Client, domain_id, 0), + AP_GROUPEND }; +static void initialize(geometry_msgs_msg_Quaternion& q) +{ + q.x = 0.0; + q.y = 0.0; + q.z = 0.0; + q.w = 1.0; +} + AP_DDS_Client::~AP_DDS_Client() { // close transport @@ -224,6 +240,9 @@ void AP_DDS_Client::populate_static_transforms(tf2_msgs_msg_TFMessage& msg) msg.transforms[i].transform.translation.y = -1 * offset[1]; msg.transforms[i].transform.translation.z = -1 * offset[2]; + // Ensure rotation is initialized. + initialize(msg.transforms[i].transform.rotation); + msg.transforms_size++; } @@ -286,8 +305,11 @@ void AP_DDS_Client::update_topic(sensor_msgs_msg_BatteryState& msg, const uint8_ msg.power_supply_technology = 0; //POWER_SUPPLY_TECHNOLOGY_UNKNOWN if (battery.has_cell_voltages(instance)) { - const uint16_t* cellVoltages = battery.get_cell_voltages(instance).cells; - std::copy(cellVoltages, cellVoltages + AP_BATT_MONITOR_CELLS_MAX, msg.cell_voltage); + const auto &cells = battery.get_cell_voltages(instance); + const uint8_t ncells_max = MIN(ARRAY_SIZE(msg.cell_voltage), ARRAY_SIZE(cells.cells)); + for (uint8_t i=0; i< ncells_max; i++) { + msg.cell_voltage[i] = cells.cells[i] * 0.001; + } } } @@ -335,6 +357,8 @@ void AP_DDS_Client::update_topic(geometry_msgs_msg_PoseStamped& msg) msg.pose.orientation.x = orientation[1]; msg.pose.orientation.y = orientation[2]; msg.pose.orientation.z = orientation[3]; + } else { + initialize(msg.pose.orientation); } } @@ -414,6 +438,8 @@ void AP_DDS_Client::update_topic(geographic_msgs_msg_GeoPoseStamped& msg) msg.pose.orientation.x = orientation[1]; msg.pose.orientation.y = orientation[2]; msg.pose.orientation.z = orientation[3]; + } else { + initialize(msg.pose.orientation); } } @@ -743,7 +769,8 @@ bool AP_DDS_Client::create() .type = UXR_PARTICIPANT_ID }; const char* participant_ref = "participant_profile"; - const auto participant_req_id = uxr_buffer_create_participant_ref(&session, reliable_out, participant_id,0,participant_ref,UXR_REPLACE); + const auto participant_req_id = uxr_buffer_create_participant_ref(&session, reliable_out, participant_id, + static_cast(domain_id), participant_ref, UXR_REPLACE); //Participant requests constexpr uint8_t nRequestsParticipant = 1; diff --git a/libraries/AP_DDS/AP_DDS_Client.h b/libraries/AP_DDS/AP_DDS_Client.h index 18dcadfc9f..27d103ca73 100644 --- a/libraries/AP_DDS/AP_DDS_Client.h +++ b/libraries/AP_DDS/AP_DDS_Client.h @@ -198,6 +198,9 @@ class AP_DDS_Client //! @brief Parameter storage static const struct AP_Param::GroupInfo var_info[]; + //! @brief ROS_DOMAIN_ID + AP_Int32 domain_id; + //! @brief Convenience grouping for a single "channel" of data struct Topic_table { const uint8_t topic_id; diff --git a/libraries/AP_DDS/tests/test_ap_dds_external_odom.cpp b/libraries/AP_DDS/tests/test_ap_dds_external_odom.cpp index 804d891e16..35d37bd97d 100644 --- a/libraries/AP_DDS/tests/test_ap_dds_external_odom.cpp +++ b/libraries/AP_DDS/tests/test_ap_dds_external_odom.cpp @@ -1,9 +1,13 @@ #include +#include + #include #include "geometry_msgs/msg/TransformStamped.h" #include +#if AP_DDS_VISUALODOM_ENABLED + const AP_HAL::HAL &hal = AP_HAL::get_HAL(); TEST(AP_DDS_EXTERNAL_ODOM, test_is_odometry_success) @@ -35,4 +39,6 @@ TEST(AP_DDS_EXTERNAL_ODOM, test_is_odometry_success) ASSERT_FALSE(AP_DDS_External_Odom::is_odometry_frame(msg)); } +#endif // AP_DDS_VISUALODOM_ENABLED + AP_GTEST_MAIN() diff --git a/libraries/AP_DroneCAN/AP_DroneCAN.cpp b/libraries/AP_DroneCAN/AP_DroneCAN.cpp index 810e1ba074..b6f3703b44 100644 --- a/libraries/AP_DroneCAN/AP_DroneCAN.cpp +++ b/libraries/AP_DroneCAN/AP_DroneCAN.cpp @@ -506,6 +506,10 @@ void AP_DroneCAN::loop(void) continue; } + // ensure that the DroneCAN thread cannot completely saturate + // the CPU, preventing low priority threads from running + hal.scheduler->delay_microseconds(100); + canard_iface.process(1); safety_state_send(); diff --git a/libraries/AP_DroneCAN/AP_DroneCAN.h b/libraries/AP_DroneCAN/AP_DroneCAN.h index 8b37c2528b..ea54c83399 100644 --- a/libraries/AP_DroneCAN/AP_DroneCAN.h +++ b/libraries/AP_DroneCAN/AP_DroneCAN.h @@ -231,10 +231,12 @@ class AP_DroneCAN : public AP_CANDriver, public AP_ESC_Telem_Backend { uint32_t *mem_pool; - AP_DroneCAN_DNA_Server _dna_server; - uint8_t _driver_index; + CanardInterface canard_iface; + + AP_DroneCAN_DNA_Server _dna_server; + char _thread_name[13]; bool _initialized; ///// SRV output ///// @@ -288,8 +290,6 @@ class AP_DroneCAN : public AP_CANDriver, public AP_ESC_Telem_Backend { } _relay; #endif - CanardInterface canard_iface; - #if AP_DRONECAN_SERIAL_ENABLED AP_DroneCAN_Serial serial; #endif diff --git a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp index a04537fdbd..6e22d62ed4 100644 --- a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp +++ b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp @@ -877,6 +877,9 @@ void UARTDriver::write_pending_bytes_DMA(uint32_t n) STM32_DMA_CR_MINC | STM32_DMA_CR_TCIE); dmaStreamEnable(txdma); uint32_t timeout_us = ((1000000UL * (tx_len+2) * 10) / _baudrate) + 500; + // prevent very long timeouts at low baudrates which could cause another thread + // using begin() to block + timeout_us = MIN(timeout_us, 100000UL); chSysUnlock(); // wait for the completion or timeout handlers to signal that we are done eventmask_t mask = chEvtWaitAnyTimeout(EVT_TRANSMIT_DMA_COMPLETE, chTimeUS2I(timeout_us)); @@ -1620,22 +1623,38 @@ bool UARTDriver::set_options(uint16_t options) cr2 &= ~USART_CR2_SWAP; _cr2_options &= ~USART_CR2_SWAP; } -#else // STM32F4 +#elif defined(STM32F4) // STM32F4 // F4 can do inversion by GPIO if enabled in hwdef.dat, using // TXINV and RXINV options if (options & OPTION_RXINV) { if (sdef.rxinv_gpio >= 0) { hal.gpio->write(sdef.rxinv_gpio, sdef.rxinv_polarity); + if (arx_line != 0) { + palLineSetPushPull(arx_line, PAL_PUSHPULL_PULLDOWN); + } } else { ret = false; } + } else if (sdef.rxinv_gpio >= 0) { + hal.gpio->write(sdef.rxinv_gpio, !sdef.rxinv_polarity); + if (arx_line != 0) { + palLineSetPushPull(arx_line, PAL_PUSHPULL_PULLUP); + } } if (options & OPTION_TXINV) { if (sdef.txinv_gpio >= 0) { hal.gpio->write(sdef.txinv_gpio, sdef.txinv_polarity); + if (atx_line != 0) { + palLineSetPushPull(atx_line, PAL_PUSHPULL_PULLDOWN); + } } else { ret = false; } + } else if (sdef.txinv_gpio >= 0) { + hal.gpio->write(sdef.txinv_gpio, !sdef.txinv_polarity); + if (atx_line != 0) { + palLineSetPushPull(atx_line, PAL_PUSHPULL_PULLUP); + } } if (options & OPTION_SWAP) { ret = false; diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CUAV-7-Nano/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CUAV-7-Nano/hwdef.dat index eea49e50f0..dcaaeb0839 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CUAV-7-Nano/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CUAV-7-Nano/hwdef.dat @@ -104,8 +104,8 @@ PC3 ADC1_3V3 ADC1 SCALE(1) ANALOG(13) define HAL_BATT_VOLT_PIN 9 define HAL_BATT_CURR_PIN 8 -define HAL_BATT_VOLT_SCALE 10.1 -define HAL_BATT_CURR_SCALE 17.0 +define HAL_BATT_VOLT_SCALE 31.0 +define HAL_BATT_CURR_SCALE 24.0 # SPI1 - IIM42652 PA5 SPI1_SCK SPI1 @@ -239,11 +239,12 @@ PE4 LED_GREEN OUTPUT GPIO(91) LOW PE5 LED_BLUE OUTPUT GPIO(92) LOW # setup for "pixracer" RGB LEDs -define AP_NOTIFY_GPIO_LED_RGB_RED_PIN 90 -define AP_NOTIFY_GPIO_LED_RGB_GREEN_PIN 91 -define AP_NOTIFY_GPIO_LED_RGB_BLUE_PIN 92 +define HAL_GPIO_A_LED_PIN 90 +define HAL_GPIO_B_LED_PIN 91 +define HAL_GPIO_C_LED_PIN 92 +define HAL_GPIO_LED_ON 0 -define AP_NOTIFY_GPIO_LED_RGB_ENABLED 1 +define HAL_HAVE_PIXRACER_LED # ID pins PG0 HW_VER_REV_DRIVE OUTPUT LOW diff --git a/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/README.md b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/README.md new file mode 100644 index 0000000000..59063de301 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/README.md @@ -0,0 +1,608 @@ +# VUAV-V7pro Flight Controller + +The VUAV-V7pro flight controller is manufactured and sold by [VIEWPRO](http://www.viewprotech.com/). + +## Features + + - STM32H743 microcontroller + - Three IMUs: ADIS16470,ICM42688,ICM42688 + - Internal vibration isolation for IMUs + - Internal RM3100 SPI magnetometer + - Internal two MS5611 SPI barometer + - Internal RGB LED + - MicroSD card slot port + - 1 Analog power port + - 1 CAN power port + - 5 UARTs and 1 USB ports + - 1 RS232 port + - 14 PWM output ports + - 4 I2C and 2 CAN ports + - Safety switch port + - Buzzer port + - RC IN port + +## Pinout + +![VUAV-V7pro-interface.png](VUAV-V7pro-interface.png) + +![VUAV-V7pro-pinout.png](VUAV-V7pro-pinout.png) + +## UART Mapping + - SERIAL0 -> USB + - SERIAL1 -> UART2 (Telem1) (DMA enabled) + - SERIAL2 -> UART6 (Telem2) (DMA enabled) + - SERIAL3 -> UART1 (GPS1) + - SERIAL4 -> UART3 (GPS2) + - SERIAL5 -> UART8 (USER) TX only on pin, RX is tied to RCIN + - SERIAL6 -> UART4 (RS232) + - SERIAL7 -> USB2 (virtual port on same connector) + - SERIAL8 -> UART7 (DEBUG) + +The Telem1,Telem2 port has RTS/CTS pins, the other UARTs do not have RTS/CTS. + +## Connectors + +### TELEM1 ,TELEM2 port + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pin Signal Volt
1VCC+5V
2TX (OUT)+3.3V
3RX (IN)+3.3V
4CTS+3.3V
5RTS+3.3V
6GNDGND
+ +### GPS1/I2C4 port + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PinSignalVolt
1VCC+5V
2TX (OUT)+3.3V
3RX (IN)+3.3V
4SCL I2C4+3.3V (pullups)
5SDA I2C4+3.3V (pullups)
6SafetyButton+3.3V
7SafetyLED+3.3V
8--
9Buzzer+3.3V
10GNDGND
+ +### GPS2/I2C3 port + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PinSignalVolt
1VCC+5V
2TX (OUT)+3.3V
3RX (IN)+3.3V
4SCL I2C3+3.3V (pullups)
5SDA I2C3+3.3V (pullups)
6GNDGND
+ +### CAN1,CAN2 port + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PinSignalVolt
1VCC+5V
2CAN_H+24V
3CAN_L+24V
4GNDGND
+ +### I2C1,I2C2 port + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PinSignalVolt
1VCC+5V
2SCL+3.3 (pullups)
3SDA+3.3 (pullups)
4GNDGND
+ +### USB Ex + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pin Signal Volt
1VCC IN+5V
2D_minus+3.3V
3D_plus+3.3V
4GNDGND
+ +### RSSI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PinSignalVolt
1VCC+5V
2RSSIup to +3.3V
3UART8_TX (OUT)+3.3
4GNDGND
+ +### RS232 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pin Signal Volt
1VCC+5V
2TX (OUT)+3.3V
3RX (IN)+3.3V
4GNDGND
+ +### DEBUG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pin Signal Volt
1VCC+5V
2TX (OUT)+3.3V
3RX (IN)+3.3V
4SWDIO+3.3V
5SWCLK+3.3V
6GNDGND
+ +### ADC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PinSignalVolt
1VCC+5V
2ADC_3V3up to +3.3V
3ADC_6V6up to +6.6V
4GNDGND
+ +### POWER1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PinSignalVolt
1VCC IN+5V
2VCC IN+5V
3CURRENTup to +3.3V
4VOLTAGEup to +3.3V
5GNDGND
6GNDGND
+ +### POWER2(CAN1) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PinSignalVolt
1VCC IN+5V
2VCC IN+5V
3CAN1_H+24V
4CAN1_L+24V
5GNDGND
6GNDGND
+ +## RC Input + +RC input is configured on the RCIN pin, at one end of the servo rail. This pin supports all unidirectional RC protocols. For bi-directional protocols, such as CRSF/ELRS, UART8 can be set to protocol "23" and the reciever tied to RCIN (shared with UART8 RX) and UART8 TX. In this case, the RC_PROTOCOLS parameter should be set to the expected protocol type to avoid accidental erroneous detection by the RCIN path. + +## PWM Output + +The VUAV-V7pro supports up to 14 PWM outputs,support all PWM protocols. Outputs 1-12 support DShot. Outputs 1-8 support bi-directional Dshot. All 14 PWM outputs have GND on the top row, 5V on the middle row and signal on the bottom row. + +The 14 PWM outputs are in 4 groups: + + - PWM 1, 2, 3 and 4 in group1 + - PWM 5, 6, 7 and 8 in group2 + - PWM 9, 10, 11 and 12 in group3 + - PWM 13, 14 in group4 + +Channels within the same group need to use the same output rate. If any channel in a group uses DShot, then all channels in that group need to use DShot. + +## GPIOs + +All 14 PWM channels can be used for GPIO functions (relays, buttons, RPM etc). +The pin numbers for these PWM channels in ArduPilot are shown below: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PWM ChannelsPinPWM ChannelsPin
PWM150PWM857
PWM251PWM958
PWM352PWM1059
PWM453PWM1160
PWM554PWM1261
PWM655PWM1362
PWM756PWM1463
+ +## Analog inputs + +The VUAV-V7pro flight controller has 5 Analog inputs + + - ADC Pin2-> Battery Current + - ADC Pin16 -> Battery Voltage + - ADC Pin19 -> ADC 3V3 Sense + - ADC Pin3 -> ADC 6V6 Sense + - ADC Pin9 -> RSSI voltage monitoring + +## Battery Monitor Configuration + +The board has voltage and current inputs sensor on the POWER1 ADC and POWER2 CAN connector. + +The correct battery setting parameters are: + +Enable Battery1 monitor: + - BATT_MONITOR 4 + - BATT_VOLT_PIN 16 + - BATT_CUR_PIN 2 + - BATT_VOLT_MULT 15.7 (may need adjustment if supplied monitor is not used) + - BATT_AMP_PERVLT 60.61 (may need adjustment if supplied monitor is not used) + +Enable Battery2 monitor (if used): + - BATT2_MONITOR 8 + +## Loading Firmware + +The VUAV-V7pro flight controller comes pre-installed with an ArduPilot compatible bootloader, allowing the loading of \*.apj firmware files with any ArduPilot compatible ground station. diff --git a/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/VUAV-V7pro-interface.png b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/VUAV-V7pro-interface.png new file mode 100644 index 0000000000..ea342dee5d Binary files /dev/null and b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/VUAV-V7pro-interface.png differ diff --git a/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/VUAV-V7pro-pinout.png b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/VUAV-V7pro-pinout.png new file mode 100644 index 0000000000..443c8cf57a Binary files /dev/null and b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/VUAV-V7pro-pinout.png differ diff --git a/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/defaults.parm b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/defaults.parm new file mode 100644 index 0000000000..181f066cec --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/defaults.parm @@ -0,0 +1,5 @@ +BRD_HEAT_TARG 45 +BRD_HEAT_P 50 +BRD_HEAT_I 0.07 + +CAN_P1_DRIVER 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/hwdef-bl.dat b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/hwdef-bl.dat new file mode 100644 index 0000000000..0d6e8bb913 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/hwdef-bl.dat @@ -0,0 +1,79 @@ +# hw definition file for processing by chibios_hwdef.py +# for H743 bootloader + +# MCU class and specific type +MCU STM32H7xx STM32H743xx + +# board ID for firmware load +APJ_BOARD_ID 7100 + +# crystal frequency +OSCILLATOR_HZ 16000000 + +FLASH_SIZE_KB 2048 + +# bootloader is installed at zero offset +FLASH_RESERVE_START_KB 0 + +FLASH_BOOTLOADER_LOAD_KB 128 + +PI5 LED_RED OUTPUT OPENDRAIN HIGH # red +PI7 LED_ACTIVITY OUTPUT OPENDRAIN HIGH # blue +PI6 LED_BOOTLOADER OUTPUT OPENDRAIN HIGH # green +define HAL_LED_ON 0 + +# order of UARTs (and USB) +SERIAL_ORDER OTG1 UART7 + +# UART7 is debug +PF6 UART7_RX UART7 NODMA +PF7 UART7_TX UART7 NODMA + +PA11 OTG_FS_DM OTG1 +PA12 OTG_FS_DP OTG1 + +PA13 JTMS-SWDIO SWD +PA14 JTCK-SWCLK SWD + +define BOOTLOADER_DEBUG SD7 + +# support flashing from SD card: +# power enable pins +PG7 VDD_3V3_SD_CARD_EN OUTPUT LOW + +# FATFS support: +define CH_CFG_USE_MEMCORE 1 +define CH_CFG_USE_HEAP 1 +define CH_CFG_USE_SEMAPHORES 0 +define CH_CFG_USE_MUTEXES 1 +define CH_CFG_USE_DYNAMIC 1 +define CH_CFG_USE_WAITEXIT 1 +define CH_CFG_USE_REGISTRY 1 + +# microSD support +PC8 SDMMC1_D0 SDMMC1 +PC9 SDMMC1_D1 SDMMC1 +PC10 SDMMC1_D2 SDMMC1 +PC11 SDMMC1_D3 SDMMC1 +PC12 SDMMC1_CK SDMMC1 +PD2 SDMMC1_CMD SDMMC1 + +define FATFS_HAL_DEVICE SDCD1 + +DMA_PRIORITY SDMMC* + +# enable FAT filesystem support (needs a microSD defined via SDMMC) +define HAL_OS_FATFS_IO 1 +define AP_BOOTLOADER_FLASH_FROM_SD_ENABLED 1 + +# Add CS pins to ensure they are high in bootloader +PG10 IMU1_CS CS +PJ2 IMU2_CS CS +PI4 IMU3_CS CS +PE8 RM3100_CS CS +PE4 BAROMETER1_CS CS +PI9 BAROMETER2_CS CS +PK2 FRAM_CS CS +PE10 RESERVE_CS1 CS +PI14 RESERVE_CS2 CS +PI15 RESERVE_CS3 CS diff --git a/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/hwdef.dat new file mode 100644 index 0000000000..4fa315f3e8 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/VUAV-V7pro/hwdef.dat @@ -0,0 +1,286 @@ +# hw definition file for processing by chibios_hwdef.py + +# MCU class and specific type +MCU STM32H7xx STM32H743xx + +# crystal frequency +OSCILLATOR_HZ 16000000 + +# board ID for firmware load +APJ_BOARD_ID 7100 + +FLASH_SIZE_KB 2048 + +# with 2M flash we can afford to optimize for speed +env OPTIMIZE -O2 + +# bootloader takes first sector +FLASH_RESERVE_START_KB 128 + +# ChibiOS system timer +STM32_ST_USE_TIMER 5 + +# order of UARTs (and USB) +SERIAL_ORDER OTG1 USART2 USART6 USART1 USART3 UART8 UART4 OTG2 UART7 + +# USB +PA11 OTG_FS_DM OTG1 +PA12 OTG_FS_DP OTG1 + +# UARTs +# USART2 is telem1 +PD6 USART2_RX USART2 +PD5 USART2_TX USART2 +PD3 USART2_CTS USART2 +PD4 USART2_RTS USART2 + +# USART6 is telem2 +PC7 USART6_RX USART6 +PC6 USART6_TX USART6 +PG15 USART6_CTS USART6 +PG8 USART6_RTS USART6 + +# USART1 is GPS1 +PB15 USART1_RX USART1 NODMA +PB14 USART1_TX USART1 NODMA + +# UART3 is GPS2 +PD9 USART3_RX USART3 NODMA +PD8 USART3_TX USART3 NODMA + +# SBUS, DSM port +PE0 UART8_RX UART8 +PE1 UART8_TX UART8 + +# RS232 +PH14 UART4_RX UART4 NODMA +PH13 UART4_TX UART4 NODMA + +# UART7 is debug +PF6 UART7_RX UART7 NODMA +PF7 UART7_TX UART7 NODMA + +# debug pins +PA13 JTMS-SWDIO SWD +PA14 JTCK-SWCLK SWD + +# SPI1 - sensors1 +PG11 SPI1_SCK SPI1 +PG9 SPI1_MISO SPI1 +PD7 SPI1_MOSI SPI1 + +# SPI2 - compass +PI1 SPI2_SCK SPI2 +PI2 SPI2_MISO SPI2 +PI3 SPI2_MOSI SPI2 + +# SPI4 - sensors2 - baro1 +PE12 SPI4_SCK SPI4 +PE13 SPI4_MISO SPI4 +PE6 SPI4_MOSI SPI4 + +# SPI6 - sensors3 - baro2 +PG13 SPI6_SCK SPI6 +PB4 SPI6_MISO SPI6 +PG14 SPI6_MOSI SPI6 + +# SPI5 - FRAM +PK0 SPI5_SCK SPI5 +PJ11 SPI5_MISO SPI5 +PJ10 SPI5_MOSI SPI5 + +# sensor CS +PG10 IMU1_CS CS +PJ2 IMU2_CS CS +PI4 IMU3_CS CS +PE8 RM3100_CS CS +PE4 BAROMETER1_CS CS +PI9 BAROMETER2_CS CS +PK2 FRAM_CS CS + +# RESERVE CS +PE10 RESERVE_CS1 CS +PI14 RESERVE_CS2 CS +PI15 RESERVE_CS3 CS + +# drdy pins +PH4 DRDY1_ADIS16470 INPUT GPIO(93) +PH10 DRDY2_ICM42688 INPUT +PE9 DRDY3_RM3100 INPUT +PH5 DRDY4_ICM42688 INPUT + +# use GPIO(93) for data ready on ADIS16470 +define ADIS_DRDY_PIN 93 + +# I2C buses + +# I2C1 is on I2C1 port +PB8 I2C1_SCL I2C1 +PB9 I2C1_SDA I2C1 + +# I2C2 on I2C2 port +PF1 I2C2_SCL I2C2 +PF0 I2C2_SDA I2C2 + +# I2C3 is on GPS2 port +PH7 I2C3_SCL I2C3 +PH8 I2C3_SDA I2C3 + +# I2C4 is on GPS1 port +PF14 I2C4_SCL I2C4 +PF15 I2C4_SDA I2C4 + +# order of I2C buses +I2C_ORDER I2C1 I2C2 I2C3 I2C4 + +NODMA I2C* +define STM32_I2C_USE_DMA FALSE +define HAL_I2C_INTERNAL_MASK 0 + +# enable pins +PE3 VDD_3V3_SENSORS_EN OUTPUT LOW + +# start peripheral power off, then enable after init +# this prevents a problem with radios that use RTS for +# bootloader hold +PD11 VDD_5V_HIPOWER_EN OUTPUT LOW +PG4 VDD_5V_PERIPH_EN OUTPUT LOW + +PD10 VDD_5V_RC_EN OUTPUT HIGH +PG7 VDD_3V3_SD_CARD_EN OUTPUT LOW + +# PWM AUX channels +PA15 TIM2_CH1 TIM2 PWM(1) GPIO(50) BIDIR +PB3 TIM2_CH2 TIM2 PWM(2) GPIO(51) +PB10 TIM2_CH3 TIM2 PWM(3) GPIO(52) BIDIR +PA3 TIM2_CH4 TIM2 PWM(4) GPIO(53) +PK1 TIM1_CH1 TIM1 PWM(5) GPIO(54) BIDIR +PE11 TIM1_CH2 TIM1 PWM(6) GPIO(55) +PJ9 TIM1_CH3 TIM1 PWM(7) GPIO(56) BIDIR +PE14 TIM1_CH4 TIM1 PWM(8) GPIO(57) +PD12 TIM4_CH1 TIM4 PWM(9) GPIO(58) +PD13 TIM4_CH2 TIM4 PWM(10) GPIO(59) +PD14 TIM4_CH3 TIM4 PWM(11) GPIO(60) +PD15 TIM4_CH4 TIM4 PWM(12) GPIO(61) +PH6 TIM12_CH1 TIM12 PWM(13) GPIO(62) NODMA +PH9 TIM12_CH2 TIM12 PWM(14) GPIO(63) NODMA + +# PWM output for buzzer +PE5 TIM15_CH1 TIM15 GPIO(77) ALARM + +# RC input +PB1 TIM3_CH4 TIM3 RCININT PULLDOWN LOW + +# analog in +PA0 BATT_VOLTAGE_SENS ADC1 SCALE(1) +PF11 BATT_CURRENT_SENS ADC1 SCALE(1) + +PA5 SPARE1_ADC1 ADC1 SCALE(1) +PA6 SPARE2_ADC1 ADC1 SCALE(2) + +PB0 RSSI_IN ADC1 SCALE(1) + +PC0 VDD_5V_SENS ADC1 SCALE(2) +PC2 SCALED_V3V3 ADC1 SCALE(2) + +PF12 FMU_SERVORAIL_VCC_SENS ADC1 SCALE(3) + +# CAN bus +PD0 CAN1_RX CAN1 +PD1 CAN1_TX CAN1 + +PB5 CAN2_RX CAN2 +PB6 CAN2_TX CAN2 + +PH2 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(70) +PH3 GPIO_CAN2_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(71) + +# GPIOs +PA8 HEATER_EN OUTPUT LOW GPIO(80) +define HAL_HEATER_GPIO_PIN 80 +define HAL_HAVE_IMU_HEATER 1 + +PG1 VDD_BRICK_nVALID INPUT PULLUP +PG2 VDD_BRICK2_nVALID INPUT PULLUP +PG0 VBUS_nVALID INPUT PULLUP +PJ3 VDD_5V_HIPOWER_nOC INPUT PULLUP +PJ4 VDD_5V_PERIPH_nOC INPUT PULLUP + +# SPI devices +SPIDEV adis16470 SPI1 DEVID1 IMU1_CS MODE3 1*MHZ 2*MHZ +SPIDEV imu1_res SPI1 DEVID2 RESERVE_CS1 MODE3 2*MHZ 8*MHZ +SPIDEV rm3100 SPI2 DEVID1 RM3100_CS MODE3 1*MHZ 1*MHZ +SPIDEV imu2 SPI4 DEVID1 IMU2_CS MODE3 2*MHZ 8*MHZ +SPIDEV baro1 SPI4 DEVID2 BAROMETER1_CS MODE3 20*MHZ 20*MHZ +SPIDEV ramtron SPI5 DEVID1 FRAM_CS MODE3 8*MHZ 8*MHZ +SPIDEV imu3 SPI6 DEVID1 IMU3_CS MODE3 2*MHZ 8*MHZ +SPIDEV baro2 SPI6 DEVID2 BAROMETER2_CS MODE3 20*MHZ 20*MHZ + +# two baro +BARO MS56XX SPI:baro1 +BARO MS56XX SPI:baro2 + +# three IMUs +IMU ADIS1647x SPI:adis16470 ROTATION_PITCH_180_YAW_270 ADIS_DRDY_PIN +IMU Invensensev3 SPI:imu1_res ROTATION_PITCH_180_YAW_270 +IMU Invensensev3 SPI:imu2 ROTATION_PITCH_180_YAW_270 +IMU Invensensev3 SPI:imu3 ROTATION_PITCH_180 + +define HAL_DEFAULT_INS_FAST_SAMPLE 7 + +# compasses + +define HAL_PROBE_EXTERNAL_I2C_COMPASSES +COMPASS RM3100 SPI:rm3100 false ROTATION_NONE + +# microSD support +PC8 SDMMC1_D0 SDMMC1 +PC9 SDMMC1_D1 SDMMC1 +PC10 SDMMC1_D2 SDMMC1 +PC11 SDMMC1_D3 SDMMC1 +PC12 SDMMC1_CK SDMMC1 +PD2 SDMMC1_CMD SDMMC1 + +# red LED marked as B/E +PI5 LED_R1 OUTPUT OPENDRAIN HIGH GPIO(0) +PI6 LED_G1 OUTPUT OPENDRAIN LOW GPIO(1) +PI7 LED_B1 OUTPUT OPENDRAIN HIGH GPIO(2) + +# setup for "pixracer" RGB LEDs +define HAL_GPIO_A_LED_PIN 0 +define HAL_GPIO_B_LED_PIN 1 +define HAL_GPIO_C_LED_PIN 2 + +# use pixracer style 3-LED indicators +define HAL_HAVE_PIXRACER_LED + +# enable RAMTROM parameter storage +define HAL_STORAGE_SIZE 32768 +define HAL_WITH_RAMTRON 1 + +# allow to have have a dedicated safety switch pin +define HAL_HAVE_SAFETY_SWITCH 1 +PE2 LED_SAFETY OUTPUT +PI13 SAFETY_IN INPUT PULLDOWN + +# build ABIN for flash-from-bootloader support: +env BUILD_ABIN False + +# enable FAT filesystem support (needs a microSD defined via SDMMC) +define HAL_OS_FATFS_IO 1 + +DMA_PRIORITY ADC* SPI1* TIM*UP* +DMA_NOSHARE SPI1* TIM*UP* + +# Enable Sagetech MXS ADSB transponder +define HAL_ADSB_SAGETECH_MXS_ENABLED HAL_ADSB_ENABLED + +# define default battery setup +define HAL_BATT_MONITOR_DEFAULT 4 +define HAL_BATT_CURR_PIN 2 +define HAL_BATT_VOLT_PIN 16 +define HAL_BATT_CURR_SCALE 60.61 +define HAL_BATT_VOLT_SCALE 15.7 + +# setup the parameter for the ADC rssi +define BOARD_RSSI_ANA_PIN 9 diff --git a/libraries/AP_Motors/AP_MotorsHeli_Single.cpp b/libraries/AP_Motors/AP_MotorsHeli_Single.cpp index 1c73e10f50..2d8da8acc0 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_Single.cpp +++ b/libraries/AP_Motors/AP_MotorsHeli_Single.cpp @@ -220,6 +220,8 @@ void AP_MotorsHeli_Single::init_outputs() case TAIL_TYPE::DIRECTDRIVE_VARPITCH: case TAIL_TYPE::DIRECTDRIVE_VARPIT_EXT_GOV: _tail_rotor.init_servo(); + // yaw servo is an angle from -4500 to 4500 + SRV_Channels::set_angle(SRV_Channel::k_motor4, YAW_SERVO_MAX_ANGLE); break; case TAIL_TYPE::SERVO_EXTGYRO: diff --git a/libraries/AP_Proximity/AP_Proximity_MR72_CAN.cpp b/libraries/AP_Proximity/AP_Proximity_MR72_CAN.cpp index 9d9618286c..d371346bf4 100644 --- a/libraries/AP_Proximity/AP_Proximity_MR72_CAN.cpp +++ b/libraries/AP_Proximity/AP_Proximity_MR72_CAN.cpp @@ -117,6 +117,7 @@ bool AP_Proximity_MR72_CAN::parse_distance_message(AP_HAL::CANFrame &frame) const AP_Proximity_Boundary_3D::Face face = frontend.boundary.get_face(yaw); _temp_boundary.add_distance(face, yaw, objects_dist); + database_push(yaw, objects_dist); return true; } diff --git a/libraries/AP_RCProtocol/AP_RCProtocol_GHST.cpp b/libraries/AP_RCProtocol/AP_RCProtocol_GHST.cpp index 9004355d8c..66493ed88d 100644 --- a/libraries/AP_RCProtocol/AP_RCProtocol_GHST.cpp +++ b/libraries/AP_RCProtocol/AP_RCProtocol_GHST.cpp @@ -280,6 +280,7 @@ bool AP_RCProtocol_GHST::decode_ghost_packet() const RadioFrame* radio_frame = (const RadioFrame*)(&_frame.payload); const Channels12Bit_4Chan* channels = &(radio_frame->channels); const uint8_t* lowres_channels = radio_frame->lowres_channels; + bool rc_frame = false; // Scaling from Betaflight // Scaling 12bit channels (8bit channels in brackets) @@ -328,6 +329,7 @@ bool AP_RCProtocol_GHST::decode_ghost_packet() _channels[offset++] = CHANNEL_LR_SCALE_LEGACY(lowres_channels[1]); _channels[offset++] = CHANNEL_LR_SCALE_LEGACY(lowres_channels[2]); _channels[offset++] = CHANNEL_LR_SCALE_LEGACY(lowres_channels[3]); + rc_frame = true; break; } case GHST_UL_RC_CHANS_HS4_12_5TO8: @@ -338,6 +340,7 @@ bool AP_RCProtocol_GHST::decode_ghost_packet() _channels[offset++] = CHANNEL_LR_SCALE(lowres_channels[1]); _channels[offset++] = CHANNEL_LR_SCALE(lowres_channels[2]); _channels[offset++] = CHANNEL_LR_SCALE(lowres_channels[3]); + rc_frame = true; break; } case GHST_UL_RC_CHANS_RSSI: @@ -355,7 +358,7 @@ bool AP_RCProtocol_GHST::decode_ghost_packet() } #endif - return true; + return rc_frame; } // send out telemetry diff --git a/modules/DroneCAN/libcanard b/modules/DroneCAN/libcanard index 0ae477b82b..6f74bc6765 160000 --- a/modules/DroneCAN/libcanard +++ b/modules/DroneCAN/libcanard @@ -1 +1 @@ -Subproject commit 0ae477b82bc18daf642383079a02710f69294aa8 +Subproject commit 6f74bc67656882a4ee51966c7c0022d04fa1a3fb diff --git a/modules/mavlink b/modules/mavlink index 1e04d8b863..2825252d6d 160000 --- a/modules/mavlink +++ b/modules/mavlink @@ -1 +1 @@ -Subproject commit 1e04d8b8634dafc8c9a2496c6922e0749e00c009 +Subproject commit 2825252d6d13eb347520f028b3c580ab29bd78e5 diff --git a/modules/waf b/modules/waf index 1b1625b8e7..b25b5c7d98 160000 --- a/modules/waf +++ b/modules/waf @@ -1 +1 @@ -Subproject commit 1b1625b8e7da6e1307d73335cb995fa8813d5950 +Subproject commit b25b5c7d98c502b07976740b0a65b9f39948c292 diff --git a/wscript b/wscript index 61fffcb8be..cb4194af20 100644 --- a/wscript +++ b/wscript @@ -528,7 +528,6 @@ def configure(cfg): cfg.msg('Setting board to', cfg.options.board) cfg.get_board().configure(cfg) - cfg.load('clang_compilation_database') cfg.load('waf_unit_test') cfg.load('mavgen') cfg.load('dronecangen')