robotnik_pad_plugins/Movement: Allow plugin to check several axis fro… #24
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.
This pull request introduces several changes to the
PadPluginMovement
class in therobotnik_pad_plugins
package to enhance the handling of accelerometer watchdog parameters and improve the robustness of the code. The most important changes include converting single-value parameters to vectors, adding a utility function to read parameters as vectors, and updating the logic to handle multiple accelerometer axes.Enhancements to accelerometer watchdog handling:
robotnik_pad_plugins/include/robotnik_pad_plugins/movement_plugin.h
: Changedaxis_accel_watchdog_
,last_accel_value_
, andlast_accel_time_
from single values to vectors to support multiple accelerometer axes.robotnik_pad_plugins/src/movement_plugin.cpp
: Updated theinitialize
method to use the newgetIntParamAsVector
function for readingaxis_accel_watchdog_
as a vector and initializedlast_accel_value_
andlast_accel_time_
vectors accordingly. [1] [2]Utility function addition:
robotnik_pad_plugins/include/robotnik_pad_plugins/movement_plugin.h
: Added thegetIntParamAsVector
function declaration to read integer parameters as vectors.robotnik_pad_plugins/src/movement_plugin.cpp
: Implemented thegetIntParamAsVector
function to handle parameters that can be either single integers or arrays of integers.Watchdog logic improvements:
robotnik_pad_plugins/src/movement_plugin.cpp
: Modified theexecute
method to iterate over theaxis_accel_watchdog_
vector and check each axis individually, updating the watchdog values and handling timeouts accordingly.