-
Notifications
You must be signed in to change notification settings - Fork 1
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
Clean rewrite of the driver in Python #13
Draft
stefanscherzinger
wants to merge
72
commits into
main
Choose a base branch
from
develop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
Goals: - Use everything that we leaned in the C++ version and build a new driver in Python - Use topics and services only (drop actions) to increase compatibility with other frameworks - Use a `lifecycle node` to provide more control over the driver's state - Support both TCP/IP and Modbus RTU grippers - Write clean and well tested functionality
This should make sure that all test nodes find each other.
This focusses the CI on the python driver.
2e1cad8
to
d53065f
Compare
Steps: - Add missing python dependencies - Drop the `IRON` workflows. That's EOL by now. - Fix `mypy` warnings for duplicate modules - Fix the setup fixture. That would require a sourced environment
d53065f
to
af5c05a
Compare
That's no longer needed with the top-level `__init__.py` file.
That's needed now with the top-level `__init__.py` file from the last commit.
6fb9199
to
e688055
Compare
We make `driver.py` executable instead. Without this, `ros2 launch ..` failed with not finding additional python dependencies from virtual environments Not sure if this is the way to go, though..
94b60d8
to
7eeb6a7
Compare
Also add boilerplate code for the `acknowledge` and the `fast_stop` services. They are only exposed in a configured driver.
7eeb6a7
to
4bd6292
Compare
Also add two tracing functions what we actually send for debugging.
This will provide low-level communication and data handling between Modbus RTU and Ethernet-based SCHUNK grippers. This will keep the ROS2 driver lean and simple.
We now support repeated connects and disconnects.
We now check if the driver's lifecycle interface is up. That's more robust.
Also add a test for checking the driver's advertised services. Use a skip decorator when no gripper (simulator) is available.
This will be handy for the ROS2 driver's service result messages.
Also rename the error, warning, and additional codes. This is more aligned with the documentation.
We might need a status check later so see if the acknowledge request actually worked.
This was missing from commit 9a9f4b4
Those are straight-forward to search in SCHUNK's manuals and avoid confusion with decimal codes.
Pymodbus uses big endian internally for encoding and decoding, so we need to stick to this.
Also add a bunch of logging. Let's see if this works on PSX.
We now wait for the correct status bits to report success. This now works with the BKS simulator.
Add a proof-of-concept Modbus RTU ROS2 wrapper
Improve modbus server
Users of the library shouldn't take care of these details. Future commits will also add more high-level functionality for the gripper's features. We needed to adjust some tests and now require the BKS simulator for most communication-related testing.
That's a better usage of system resources.
We'll call this in every high-level function. This leads to less code and is the common practice with SCHUNK modules.
We'll use this in all high-level functions.
That's now in line with the rest of the bit operations.
All of these high-level api functions will wrap bit-related operations and module interaction as good as possible. This will lead to a thin ROS2 driver wrapper.
This is now as thin as we want it. Also drop receiving the module's state periodically in the driver. The library does that now.
Design highlevel API
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.
Features