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

Extend spec with services capability #344

Merged
merged 4 commits into from
Jan 24, 2023
Merged

Extend spec with services capability #344

merged 4 commits into from
Jan 24, 2023

Conversation

achim-k
Copy link
Collaborator

@achim-k achim-k commented Jan 17, 2023

Public-Facing Changes

  • Adds additional operations to allow clients to call services that are advertised by the server

Description
Adds additional operations to allow clients to call services that are advertised by the server

FG-1456

@achim-k achim-k requested a review from jhurliman January 17, 2023 20:55
docs/spec.md Outdated Show resolved Hide resolved
@@ -60,6 +64,7 @@ Each JSON message must be an object containing a field called `op` which identif
- `parameters`: Allow clients to get & set parameters
- `parametersSubscribe`: Allow clients to subscribe to parameter changes
- `time`: The server may publish binary [time](#time) messages
- `services`: Allow clients to call services
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, if the server never advertises a service there are no services for the client to call :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `services`: Allow clients to call services
- `services`: Server can advertise services which clients may call

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This capability seems redundant. If a server can't advertise services, then it won't advertise any services. If it does advertise a service, why should a client make an additional check to ensure the services capability was set? And what should it do if a service is advertised, but the capability is not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may help a client to know whether the server will potentially announce services or not. But I do not have a strong opinion on this. @jtbandes what do you think?

docs/spec.md Outdated Show resolved Hide resolved
docs/spec.md Outdated Show resolved Hide resolved
@achim-k achim-k requested a review from jtbandes January 17, 2023 21:20
docs/spec.md Outdated Show resolved Hide resolved
docs/spec.md Outdated Show resolved Hide resolved
docs/spec.md Outdated Show resolved Hide resolved
docs/spec.md Outdated Show resolved Hide resolved
@achim-k achim-k changed the title [DRAFT] Extend spec with services capability Extend spec with services capability Jan 20, 2023
@achim-k achim-k requested review from jhurliman and jtbandes January 20, 2023 13:43
- `op`: string `"advertiseServices"`
- `services`: array of:
- `id`: number. The server may reuse ids when services disappear and reappear, but only if the services keeps the exact same name, type, and schema. Clients will use this unique id to cache schema info and deserialization routines.
- `name`: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should explain that the service name does not need to be unique. If services are uniquely named, let's drop the duplicate unique identifier id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may happen that a service is unadvertised and a new service with the same name but different type is advertised. In this case the name is not unique.

@achim-k achim-k merged commit e2ad9af into main Jan 24, 2023
@achim-k achim-k deleted the achim/spec_services branch January 24, 2023 20:56
achim-k added a commit that referenced this pull request Jan 27, 2023
**Public-Facing Changes**
- Updates `@foxglove/ws-protocol` to implement service operations added
in #344


**Description**
- Updates `@foxglove/ws-protocol` to implement service operations added
in #344
- Minor cleanup in the way client messages are being handled
achim-k added a commit to foxglove/ros-foxglove-bridge that referenced this pull request Feb 7, 2023
**Public-Facing Changes**
- Add ROS1 support for calling server-advertised services

**Description**
- Adds ROS1 support for advertising/unadvertising services and allowing
clients to call them
- Implements the services spec that was added in
foxglove/ws-protocol#344

Implementation details:
- The service type is unfortunately not stored on the ROS master, so for
every new service, a connection to the service server has to be opened
to fetch the service type from the connection header
- For ROS1, one can call services with a custom type (here
`GenericService`) when one defines the `ros::service_traits` and
`ros::serialization` traits


Fixes #10 (together with #142)
achim-k added a commit to foxglove/ros-foxglove-bridge that referenced this pull request Feb 7, 2023
**Public-Facing Changes**
- Add ROS2 support for calling server-advertised services

**Description**
Based on #136 

- Adds experimental ROS2 support for advertising/unadvertising services
and allowing clients to call them
- Implements the services spec that was added in
foxglove/ws-protocol#344

Implementation details:

The main problem is, that symbols from getting the service type support
are missing from the `rosidl_typesupport_cpp` libraries that are
generated for each msg/srv package (see
ros2/rosidl_typesupport#122). There is an open
pull request (ros2/rosidl_typesupport#114) to
fix that, but so far it hasn't been merged.

I found a working, yet little bit hacky, workaround for this problem
which is described more in detail here:

https://github.com/foxglove/ros-foxglove-bridge/blob/f978c182185e5deda93a6518132b6d3c339dcaeb/ros2_foxglove_bridge/src/generic_client.cpp#L59-L89

All in all, the implementation is working, but I would consider it as
experimental for now. I am not sure if this approach would work on
windows / mac
pezy pushed a commit to pezy/ws-protocol that referenced this pull request Jul 27, 2023
**Public-Facing Changes**
- Adds additional operations to allow clients to call services that are
advertised by the server


**Description**
Adds additional operations to allow clients to call services that are
advertised by the server

FG-1456

Co-authored-by: Jacob Bandes-Storch <[email protected]>
pezy pushed a commit to pezy/ws-protocol that referenced this pull request Jul 27, 2023
…ve#347)

**Public-Facing Changes**
- Updates `@foxglove/ws-protocol` to implement service operations added
in foxglove#344


**Description**
- Updates `@foxglove/ws-protocol` to implement service operations added
in foxglove#344
- Minor cleanup in the way client messages are being handled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants