Skip to content
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

Add a minimalist dummy for simulating communication #8

Merged
merged 35 commits into from
Aug 5, 2024

Conversation

stefanscherzinger
Copy link
Member

@stefanscherzinger stefanscherzinger commented Jul 9, 2024

Rationale

We need a fast and parallelizable way to test ongoing developments. This should be a simple dummy that simulates the gripper's side of the communication.

Steps

  • Add boilerplate code for a webserver
  • Support custom ports in the driver.
    • Curl uses 80 as default for http requests. This requires sudo privileges and is unhandy for testing.
  • Start the dummy for the gripper tests
  • Make the gripper a ROS2 package
  • Make sure that the dummy can be discovered as an EGU/EGK gripper
  • Test if all relevant interfaces come up
  • Support driving to absolute positions

This will mimic the real gripper's web server.
This makes testing easier with non-default ports in the dummy server.
The default port (`80`) would require sudo privileges.
That's now more consistent with the rest.
- Move the launch fixture into `conftest.py`.
  This will probably be used by several test files.

- Add a test to check whether the gripper's joint state topic gets
  published.
That's easier for installation and usage in the driver's test
repository.
The idea is, still, to keep the dummy ROS2-free in case we want to
ship it separately.
Also add a script to read `data.json` from real gripper hardware.
By keeping realistic metadata in the dummy, we can process
_offset_-based requests and requests for several instances at the same
time.

Also implement enum requests and add more tests.
Also split the processing of GET requests in the server depending on the path.
This makes the individual functions smaller and better to read.
Also support comments in the `system_parameter_codes` file when reading
system parameters from hardware.
We'll later need something less hard-coded here.
@stefanscherzinger stefanscherzinger force-pushed the add-test-dummy branch 3 times, most recently from cfb7e20 to 1f97dba Compare July 22, 2024 16:09
@stefanscherzinger stefanscherzinger force-pushed the add-test-dummy branch 7 times, most recently from 613bb18 to 56dcf2e Compare July 25, 2024 05:41
`Success` is more common and more concise.
Also use a convenience method for getting specific driver state
variables by topic.
This makes bit operations on these data easier than with immutable
strings.
Also add image documentation for the different plc data messages and
double words.
Also drop the pydantic message type.
We currently don't make use of this in the ROS2 C++ driver.
Also
- Move behavior-related tests into `test_dummy.py`. They make more sense
  there
- Adapt the ROS2 test for checking whether the driver is ready after
  startup. The driver should be operational after start by acknowledging
  internal errors.
Also provide a mechanism to set actual position and velocity in the
internal data. These data will be requested periodically by the driver.
We'll need this for toggling the `command received` bit for most
plc commands.
This seems the cleanest approach for now for giving immediate results to
post requests and having the motion run in the background.
Also adapt the unit tests accordingly.
Using a linear motion profile should be sufficient for now.
This is currently not very helpful.
Let's get that back once we are interested in latest updates on
`Rolling`.
@stefanscherzinger stefanscherzinger merged commit ed4d9ac into main Aug 5, 2024
7 checks passed
@stefanscherzinger stefanscherzinger deleted the add-test-dummy branch August 5, 2024 15:38
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.

1 participant