Repository navigation
Plugin tests - #2258
Merged
Merged
Plugin tests#2258
Conversation
Replace the hardcoded PARAM_TIMEOUT/LIST_TIMEOUT/RETRIES_COUNT constants with node-declared parameters (param_set_timeout, param_list_timeout, param_retries) so the timeout/retry behavior can be tuned and tested. Recreate the retry wall-timer when param_set_timeout changes. Also zero-initialize the mavlink_param_union_t in to_param_set() to avoid undefined-behaviour padding bytes leaking into the PARAM_SET payload. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Replace the hardcoded WP_TIMEOUT/LIST_TIMEOUT/RETRIES_COUNT/RESCHEDULE_TIME constants in MissionBase with node-declared parameters (mission_wp_timeout, mission_list_timeout, mission_retries, mission_reschedule_time) so the timeout/retry behavior can be tuned and tested. Recreate the retry wall-timer when mission_wp_timeout changes. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Add gmock/gtest suites that exercise the exposed ROS API of the command, param and waypoint (mission) plugins over real ROS interfaces, using a shared TestUAS fixture that captures outbound MAVLink from mavlink_sink and injects inbound messages via plugin_route. - command (mavros-plugin-command): each ~/cmd service, COMMAND_LONG/INT payload, ACK result, ACK timeout, broadcast/non-ACK paths. - param (mavros-plugin-param): set/pull/get flows, Parameter conversion, set/pull timeouts, excluded/unknown-parameter rejections. - mission (mavros-plugin-mission): pull/push/clear/set_current handshakes, item retry, push/pull timeouts, partial-push rejection. The plugin .cpp files are compiled into the test TUs to keep the approach refactor-free where the classes are otherwise internal. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Add a reference to the relevant MAVLink microservice (subprotocol) page in the doxygen description of each plugin that maps to one. The references flow through the existing doc extractor/template pipeline. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Regenerated plugin index.json and markdown docs from the updated source comments (mavlink subprotocol references). Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Generate a combined plugin index (docs/plugins/index.md) listing every mavros and mavros_extras plugin with its ROS API surface (publishers, subscribers, services, clients, MAVLink sub/pub) and links to the full per-plugin reference. The index is produced by plugin_doc_gen --plugin-index and wired into gendoc.sh. Add a Documentation link to the readthedocs site and the plugin index from the top-level README. Remove the obsolete docs/mavlink-e2e-tests-plan.md (pymavlink E2E coverage is landed and the router is covered by benchmarks). Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
When scanning for a description comment above a create_publisher/service declaration, skip a single assignment-prefix line (e.g. "foo_pub =") so a //! comment placed above the whole statement is attributed to the created entity. This matches the standard multi-line declaration style used across the plugins. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Add one-line //! descriptions for every exposed publisher, subscriber, service, client and parameter across all mavros and mavros_extras plugins, so the generated per-plugin docs describe what each ROS entity does. Regenerate the plugin docs and index, and add a readthedocs Documentation badge to the README. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Fix two classes of failures seen only on the CI runners (not locally): - Initialize rclcpp once per test binary instead of per test. Repeated rclcpp::init()/shutdown() across the integration tests hung on lyrical and rolling CI (FastDDS SHM / context teardown). Add TestUAS::Init() called from main() and stop calling shutdown() in the fixture. - Match the capture subscription QoS to the sink publisher (best_effort + durability_volatile). On humble this avoided the intraprocess-communication exception thrown while subscribing in SetUp, which crashed the mission suite. Also move the pure Parameter conversion tests into a lightweight fixture that does not construct the ROS node stack, reducing node churn. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Plugin nodes enable intra-process comms, but rclcpp (e.g. humble) rejects creating a latched (transient_local) publisher or subscription on an intra-process node: "intraprocess communication allowed only with volatile durability". This made the waypoint/geofence/rallypoint/global_position/ home_position/sys_status plugins (which publish latched state) fail to start on humble, and the mission plugin test crash in CI. Add NonIntraProcessPublisherOptions()/NonIntraProcessSubscriptionOptions() helpers and pass them to the transient_local publishers and subscriptions, so those entities opt out of intra-process delivery while volatile topics keep the zero-copy path. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Link the auto-generated per-package C++/Python API reference (docs.ros.org/en/rolling/p/mavros*, libmavconn) from the README and the docs index, alongside the readthedocs site and plugin index. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Agents must never print, echo, export, or otherwise output the value of any *_TOKEN/*_SECRET/*_KEY ... environment variable, referencing them only by name (e.g. "$GITHUB_MCP_RO_TOKEN") and preferring MCP/tooling that handles auth internally. Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds service-based integration tests for the
command,param, andwaypoint(mission) plugins that exercise the exposed ROS API over real ROS interfaces — including error handling and timeout paths — plus a complete plugin ROS API documentation pass.Tests
Three new gtest suites (
mavros-plugin-command,mavros-plugin-param,mavros-plugin-mission) built on a sharedTestUASfixture that captures outbound MAVLink frommavlink_sinkand injects inbound messages viaplugin_route:~/cmdservice,COMMAND_LONG/COMMAND_INTpayloads, ACK results, ACK timeout, broadcast/non-ACK paths.Parameterconversion, set/pull timeouts, excluded/unknown-parameter rejections.The plugin
.cppfiles are compiled into the test TUs to keep the approach refactor-free where the classes are otherwise internal.Production changes
paramandMissionBaseexpose~param/…and~mission/…timeout/retry parameters instead of hardcoded constants (defaults preserved), so timeout behavior is tunable and testable.NonIntraProcessPublisherOptions/SubscriptionOptionsand applied them to the transient_local (latched) publishers/subscriptions acrosswaypoint,geofence,rallypoint,global_position,home_position,sys_status, andguided_target, so volatile topics keep the zero-copy path.mavlink_param_union_tinParameter::to_param_set()to avoid undefined-behaviour padding bytes inPARAM_SET.Docs
docs/plugins/index.md) listing all plugins with their ROS API surface, generated by a new--plugin-indexmode and wired intogendoc.shand the mkdocs site.docs.ros.organd the readthedocs site from the README/docs index (with a readthedocs badge).docs/mavlink-e2e-tests-plan.md(pymavlink E2E landed; router covered by benchmarks).CI
Passing on all distros (humble, jazzy, kilted, lyrical, rolling). Includes hardening for CI-only flakes: initialize rclcpp once per test binary, match the capture subscription QoS, and the latched/intra-process fix above.