-
Notifications
You must be signed in to change notification settings - Fork 8
Add elevator_action_plugin #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ros-devel
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new action-based elevator control plugin (PadPluginElevatorAction) to complement the existing service-based elevator plugin. The new plugin enables joystick control of elevator actions (raise, lower, stop) through ROS actionlib, providing asynchronous action execution with callbacks.
Key changes:
- Implements new elevator action plugin with actionlib integration for asynchronous elevator control
- Adds actionlib dependency to build and package configuration
- Registers the new plugin through pluginlib mechanism for runtime loading
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| robotnik_pad_plugins/src/elevator_action_plugin.cpp | Core implementation of the action-based elevator plugin with goal sending and callback handling |
| robotnik_pad_plugins/include/robotnik_pad_plugins/elevator_action_plugin.h | Header file defining the PadPluginElevatorAction class interface and member variables |
| robotnik_pad_plugins/CMakeLists.txt | Adds actionlib dependency and includes new plugin source in build |
| robotnik_pad_plugins/package.xml | Declares actionlib as build dependency (missing exec_depend) |
| robotnik_pad_plugins/robotnik_pad_pluginlib.xml | Registers the new plugin for pluginlib discovery |
| robotnik_pad_plugins/src/generic_pad_plugins.cpp | Exports the new plugin class for pluginlib |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bool PadPluginElevatorAction::sendGoal(const int action) | ||
| { | ||
| robotnik_msgs::SetElevatorGoal elevator_goal; | ||
| elevator_goal.action.action = action; | ||
| ROS_INFO_NAMED("PadPluginElevatorAction", "PadPluginElevatorAction::execute: %d", action); |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error message is unclear: The log message "PadPluginElevatorAction::execute: %d" doesn't clearly indicate what action is being performed. Consider using more descriptive messages like "Sending elevator action: %d" or adding action name strings (RAISE/LOWER/STOP) to make debugging easier.
| bool PadPluginElevatorAction::sendGoal(const int action) | |
| { | |
| robotnik_msgs::SetElevatorGoal elevator_goal; | |
| elevator_goal.action.action = action; | |
| ROS_INFO_NAMED("PadPluginElevatorAction", "PadPluginElevatorAction::execute: %d", action); | |
| // Helper function to convert action int to string | |
| static const char* elevatorActionToString(int action) { | |
| switch (action) { | |
| case robotnik_msgs::ElevatorAction::RAISE: | |
| return "RAISE"; | |
| case robotnik_msgs::ElevatorAction::LOWER: | |
| return "LOWER"; | |
| case robotnik_msgs::ElevatorAction::STOP: | |
| return "STOP"; | |
| default: | |
| return "UNKNOWN"; | |
| } | |
| } | |
| bool PadPluginElevatorAction::sendGoal(const int action) | |
| { | |
| robotnik_msgs::SetElevatorGoal elevator_goal; | |
| elevator_goal.action.action = action; | |
| ROS_INFO_NAMED("PadPluginElevatorAction", "Sending elevator action: %s (%d)", elevatorActionToString(action), action); |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@jamendezib I've opened a new pull request, #33, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request adds a new elevator action pad plugin to the
robotnik_pad_pluginspackage, enabling joystick control of elevator actions via ROS actionlib. The main changes include the implementation of the elevator action plugin, integration with build and package configuration files, and plugin registration.Elevator action plugin implementation:
src/elevator_action_plugin.cppand headerinclude/robotnik_pad_plugins/elevator_action_plugin.himplementingPadPluginElevatorAction, which sends elevator commands (raise, lower, stop) using actionlib based on joystick input. [1] [2]Build and package configuration:
CMakeLists.txtto includeactionlibas a dependency and add the new plugin source file to the build. [1] [2]package.xmlto declareactionlibas a build and exec dependency.Plugin registration:
robotnik_pad_pluginlib.xmland exported it usingPLUGINLIB_EXPORT_CLASSingeneric_pad_plugins.cpp. [1] [2] [3]