Skip to content

Conversation

@jamendezib
Copy link
Contributor

This pull request adds a new elevator action pad plugin to the robotnik_pad_plugins package, 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:

  • Added new source file src/elevator_action_plugin.cpp and header include/robotnik_pad_plugins/elevator_action_plugin.h implementing PadPluginElevatorAction, which sends elevator commands (raise, lower, stop) using actionlib based on joystick input. [1] [2]

Build and package configuration:

  • Updated CMakeLists.txt to include actionlib as a dependency and add the new plugin source file to the build. [1] [2]
  • Updated package.xml to declare actionlib as a build and exec dependency.

Plugin registration:

  • Registered the new plugin in robotnik_pad_pluginlib.xml and exported it using PLUGINLIB_EXPORT_CLASS in generic_pad_plugins.cpp. [1] [2] [3]

Copy link

Copilot AI left a 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.

Comment on lines +74 to +78
bool PadPluginElevatorAction::sendGoal(const int action)
{
robotnik_msgs::SetElevatorGoal elevator_goal;
elevator_goal.action.action = action;
ROS_INFO_NAMED("PadPluginElevatorAction", "PadPluginElevatorAction::execute: %d", action);
Copy link

Copilot AI Nov 25, 2025

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Dec 17, 2025

@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.

jamendezib and others added 2 commits December 17, 2025 13:05
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.

2 participants