Skip to content

Add context-aware diagnostic tasks - #51

Open
Daniiiil1 wants to merge 1 commit into
micro-ROS:masterfrom
Daniiiil1:codex/task-callback-context
Open

Add context-aware diagnostic tasks#51
Daniiiil1 wants to merge 1 commit into
micro-ROS:masterfrom
Daniiiil1:codex/task-callback-context

Conversation

@Daniiiil1

Copy link
Copy Markdown

Summary

  • add rclc_diagnostic_task_init_with_context for callbacks that need instance-specific state
  • keep the existing rclc_diagnostic_task_init source-compatible and explicitly initialize its new fields
  • dispatch legacy and context-aware callbacks through the same updater path
  • replace global state in the website-checker example with a task context
  • document the API and add unit coverage for legacy initialization, context delivery, callback execution, and invalid arguments

The API follows the existing rclc pattern: the context pointer is supplied after the callback during initialization and is passed as the callback's final argument. A null context is allowed; a null callback is rejected.

Closes #15.

Validation

  • git diff --check
  • cppcheck on the changed C/C++ implementation, example, and tests (only pre-existing warnings outside the new code)
  • DCO sign-off included

The local machine does not have a ROS 2 / colcon workspace, so the Humble and Rolling builds and gtests are delegated to the repository CI.

Signed-off-by: Daniil Mordanov <153565951+Daniiiil1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide the ability to pass a context when setting up a task

1 participant