feat(robot_driver): add tool GPIO get/set to RobotDriver - #13
Open
erwinkendo wants to merge 1 commit into
Open
erwinkendo wants to merge 1 commit into
erwinkendo wants to merge 1 commit into
Conversation
Adds virtual get_tool_gpio()/set_tool_gpio() with default implementations that store and return a std::array<bool, 2> member (value-initialised to {false, false}). Ported from SmartArmStack/sas_core feature/tool_gpio. The sas_robot_driver_example now checks the default value and a set/get round-trip.
This was referenced Oct 2, 2026
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.
This PR adds a generic interface to
RobotDriverfor controlling the digital outputs on a robot's tool (wrist) connector.This functionality was originally developed against
SmartArmStack/sas_core. It is ported here because the C++ core now lives insas_cpp.Changes
include/marinholab/sas/core/sas_robot_driver.hppstd::array<bool, 2> tool_gpio_{}(value-initialised to{false, false}).get_tool_gpio()andset_tool_gpio(const std::array<bool, 2>&).#include <array>.src/sas_robot_driver.cpptool_gpio_. Concrete drivers override them to command the hardware.examples/sas_robot_driver_example_main.cpp{false, false}default and a set/get round-trip, throwing on failure, so the check also runs in Release builds.docker/build.shruns this example, so CI covers it.Backwards compatibility
The methods are virtual and have default implementations, so existing drivers build and behave exactly as before.
Related PRs
This change is used by follow-up changes on these branches. PRs will be opened once this one is merged and released:
PRs 2 and 3 need a
libmarinholab-sas-corerelease that includes this change.Testing
-Wall -Wextra -Wpedantic. No new warnings.sas_robot_driver_examplepasses the new tool GPIO checks.sas_robot_driverandsas_robot_driver_urbranches (see PR 4).Open question
The array size is fixed at 2 to match the UR wrist connector. If you'd prefer to keep this robot-agnostic, I can change it to
std::vector<bool>or a template size.