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

RSDK-1979 add motion service #55

Merged
merged 23 commits into from
Apr 12, 2023

Conversation

maximpertsov
Copy link
Contributor

@maximpertsov maximpertsov commented Apr 7, 2023

JIRA: https://viam.atlassian.net/browse/RSDK-1979

  • Add motion service wrapper.
  • Shape wrapper interface to accept plain objects rather than protobuf objects - these should match the interface we get from protobufs' AsObject interface. Sadly these is no built-in fromObject method so we have to write functions for this.

return {
x: proto.getX(),
y: proto.getY(),
z: proto.getZ(),
};
};

Copy link
Contributor Author

@maximpertsov maximpertsov Apr 11, 2023

Choose a reason for hiding this comment

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

import pb from '../../gen/service/motion/v1/motion_pb';

export type MotionConstraints = pb.Constraints.AsObject;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of the code below will go away once we migrate to protobuf-es since that library generate protobuf structures that are essentially plain objects. for now we need to have custom functions to convert from objects -> protos.

@maximpertsov maximpertsov marked this pull request as ready for review April 11, 2023 21:54
@maximpertsov maximpertsov requested a review from cheukt April 11, 2023 21:54
@maximpertsov
Copy link
Contributor Author

I tested these changes against a live arm. Unfortunately we actually use the motionApi yet so we might have to wait for it to be developed more to test that wrapper.

Copy link
Member

@cheukt cheukt left a comment

Choose a reason for hiding this comment

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

LGTM

@maximpertsov maximpertsov merged commit 6d70b71 into viamrobotics:main Apr 12, 2023
@maximpertsov maximpertsov deleted the RSDK-1979-motion branch April 12, 2023 18:36
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.

2 participants