Skip to content

Inconsistencies regarding Action, Topic and Service #1140

@ikwilnaarhuisman

Description

@ikwilnaarhuisman

While implementing Actions, Topics and Services I ran into a minor inconvenience; to instantiate each of these types it's rather inconsistent.

You can instantiate a (ROS2) Action without defining TGoal, TFeedback and TResult. Because it defaults to unknown. This is great when you're actively developing and don't know the definition just yet.

ref:

/**
 * A ROS 2 action client.
 */
export default class Action<
  TGoal = unknown,
  TFeedback = unknown,
  TResult = unknown,
> {

This isn't the case for Topic and Service. So for every new instance you create of these two you have to define their related types. When working with Webstorm (Which forces you to fill them in and fair) this is quite annoying.

Ref:

/**
 * Publish and/or subscribe to a topic in ROS.
 *
 * Emits the following events:
 *  * 'warning' - If there are any warning during the Topic creation.
 *  * 'message' - The message data from rosbridge.
 */
export default class Topic<T> extends EventEmitter<{

And:

/**
 * A ROS service client.
 */
export default class Service<TRequest, TResponse> extends EventEmitter {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions