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 use new motion service wrapper #2235

Merged
merged 22 commits into from
Apr 20, 2023

Conversation

maximpertsov
Copy link
Contributor

@maximpertsov maximpertsov commented Apr 18, 2023

Depends on viamrobotics/viam-typescript-sdk#55

Supersedes: #2189 - go there to see discussions

  • Updates arm and motion api wrappers based on changes in PR above
  • Makes various changes to appease linter

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Apr 18, 2023
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 18, 2023
@maximpertsov maximpertsov marked this pull request as ready for review April 18, 2023 18:17
@maximpertsov maximpertsov requested review from nicksanford and removed request for micheal-parks and nicksanford April 18, 2023 18:17
code: status.code,
metadata: status.metadata,
};
getPointCloudMap.on('status', (status?) => {
Copy link
Member

Choose a reason for hiding this comment

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

  1. what does it mean if status is undefined?
  2. why is this changing?

Copy link
Contributor Author

@maximpertsov maximpertsov Apr 18, 2023

Choose a reason for hiding this comment

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

this is no longer changing - I think I simply made a mistake here, I can't reproduce the linting error I got before that led me to make this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

repeated my smoke test from before and saw the same behavior after reverting this change.

reject(error);
}
});
getPointCloudMap.on('end', (end: { code: number }) => {
getPointCloudMap.on('end', (end?: { code: number }) => {
Copy link
Member

Choose a reason for hiding this comment

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

  1. what does it mean if end is undefined?
  2. why is this changing?

Copy link
Contributor Author

@maximpertsov maximpertsov Apr 18, 2023

Choose a reason for hiding this comment

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

  1. what does it mean if end is undefined?

This means the response was closed without a valid grpc-status. This can happen if the server shuts down or receives a malformed request.

  1. why is this changing?

My best guess is that types were mis-configured on the typescript side - we recently made a change to address this. In this case, we were properly handing status being undefined, but just did not have the correct type signature to reflect this.

EDIT: this signature is from generated pb service code - I can't find any record of the signature being different.

@@ -84,7 +81,7 @@ const fetchSLAMPose = (name: string): Promise<commonApi.Pose> => {
props.client.slamService.getPosition(
req,
new grpc.Metadata(),
(error: ServiceError, res: slamApi.GetPositionResponse): void => {
(error: ServiceError | null, res: slamApi.GetPositionResponse | null): void => {
Copy link
Member

Choose a reason for hiding this comment

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

is it fair to say that one & only one of error and res will be defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is unclear

in the logic below it looks like we are handling this case a "successful" response is null. (i.e. we are calling resp! instead of just resp).

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 18, 2023
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 18, 2023
@@ -56,7 +56,7 @@ const fetchSLAMMap = (name: string): Promise<Uint8Array> => {
const chunk = res.getPointCloudPcdChunk_asU8();
chunks.push(chunk);
});
getPointCloudMap.on('status', (status: { code: number, details: string, metadata: string }) => {
getPointCloudMap.on('status', (status: { code: number, details: string, metadata: grpc.Metadata }) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, now this is just a typing change - no logic changes. see #2235 (comment) for more context

@maximpertsov
Copy link
Contributor Author

@nicksanford slam.vue only has typing changes now - the logical flow remains as is.

@nicksanford
Copy link
Member

@nicksanford slam.vue only has typing changes now - the logical flow remains as is.

In that case I have no objections & can be removed as a reviewer. Thanks for checking in!

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 18, 2023
@maximpertsov maximpertsov requested review from cheukt and nicksanford and removed request for nicksanford April 18, 2023 20:36
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
Copy link
Contributor Author

maximpertsov commented Apr 18, 2023

@nicksanford slam.vue only has typing changes now - the logical flow remains as is.

In that case I have no objections & can be removed as a reviewer. Thanks for checking in!

Cool, though now need to approve since you requested changes earlier - I can't take you off once you do that.

@github-actions
Copy link
Contributor

Code Coverage

Package Line Rate Delta Health
go.viam.com/rdk/components/arm 64% 0.00%
go.viam.com/rdk/components/arm/fake 31% 0.00%
go.viam.com/rdk/components/arm/universalrobots 40% 0.00%
go.viam.com/rdk/components/arm/wrapper 19% 0.00%
go.viam.com/rdk/components/arm/xarm 6% 0.00%
go.viam.com/rdk/components/arm/yahboom 6% 0.00%
go.viam.com/rdk/components/audioinput 53% -0.34%
go.viam.com/rdk/components/base 56% 0.00%
go.viam.com/rdk/components/base/agilex 62% 0.00%
go.viam.com/rdk/components/base/boat 41% 0.00%
go.viam.com/rdk/components/base/fake 53% 0.00%
go.viam.com/rdk/components/base/wheeled 74% 0.00%
go.viam.com/rdk/components/board 65% 0.00%
go.viam.com/rdk/components/board/fake 38% 0.00%
go.viam.com/rdk/components/board/genericlinux 22% 0.00%
go.viam.com/rdk/components/board/numato 19% 0.00%
go.viam.com/rdk/components/board/pi 50% 0.00%
go.viam.com/rdk/components/camera 64% 0.00%
go.viam.com/rdk/components/camera/align 64% 0.00%
go.viam.com/rdk/components/camera/fake 71% 0.00%
go.viam.com/rdk/components/camera/ffmpeg 76% -1.43%
go.viam.com/rdk/components/camera/rtsp 44% 0.00%
go.viam.com/rdk/components/camera/transformpipeline 78% 0.00%
go.viam.com/rdk/components/camera/videosource 34% 0.00%
go.viam.com/rdk/components/encoder 68% 0.00%
go.viam.com/rdk/components/encoder/AMS 3% 0.00%
go.viam.com/rdk/components/encoder/fake 75% 0.00%
go.viam.com/rdk/components/encoder/incremental 76% 0.00%
go.viam.com/rdk/components/encoder/single 78% 0.00%
go.viam.com/rdk/components/gantry 58% 0.00%
go.viam.com/rdk/components/gantry/multiaxis 85% 0.00%
go.viam.com/rdk/components/gantry/oneaxis 86% 0.00%
go.viam.com/rdk/components/generic 82% 0.00%
go.viam.com/rdk/components/gripper 67% 0.00%
go.viam.com/rdk/components/input 86% 0.00%
go.viam.com/rdk/components/input/fake 86% 0.00%
go.viam.com/rdk/components/input/gpio 84% 0.00%
go.viam.com/rdk/components/motor 76% 0.00%
go.viam.com/rdk/components/motor/dimensionengineering 63% 0.00%
go.viam.com/rdk/components/motor/dmc4000 69% 0.00%
go.viam.com/rdk/components/motor/fake 56% 0.00%
go.viam.com/rdk/components/motor/gpio 66% +0.41%
go.viam.com/rdk/components/motor/gpiostepper 52% 0.00%
go.viam.com/rdk/components/motor/tmcstepper 62% 0.00%
go.viam.com/rdk/components/motor/ulnstepper 52% 0.00%
go.viam.com/rdk/components/movementsensor 74% 0.00%
go.viam.com/rdk/components/movementsensor/adxl345 66% 0.00%
go.viam.com/rdk/components/movementsensor/cameramono 45% 0.00%
go.viam.com/rdk/components/movementsensor/gpsnmea 36% 0.00%
go.viam.com/rdk/components/movementsensor/gpsrtk 29% 0.00%
go.viam.com/rdk/components/movementsensor/mpu6050 83% 0.00%
go.viam.com/rdk/components/posetracker 84% 0.00%
go.viam.com/rdk/components/sensor 66% 0.00%
go.viam.com/rdk/components/sensor/ultrasonic 31% 0.00%
go.viam.com/rdk/components/servo 66% 0.00%
go.viam.com/rdk/components/servo/gpio 71% 0.00%
go.viam.com/rdk/config 78% 0.00%
go.viam.com/rdk/control 57% 0.00%
go.viam.com/rdk/data 77% 0.00%
go.viam.com/rdk/examples/customresources/demos/remoteserver 0% 0.00%
go.viam.com/rdk/grpc 25% 0.00%
go.viam.com/rdk/ml 67% 0.00%
go.viam.com/rdk/ml/inference 71% 0.00%
go.viam.com/rdk/module 76% 0.00%
go.viam.com/rdk/module/modmanager 80% 0.00%
go.viam.com/rdk/motionplan 71% 0.00%
go.viam.com/rdk/operation 82% 0.00%
go.viam.com/rdk/pointcloud 69% 0.00%
go.viam.com/rdk/protoutils 49% 0.00%
go.viam.com/rdk/referenceframe 72% 0.00%
go.viam.com/rdk/registry 83% 0.00%
go.viam.com/rdk/resource 84% 0.00%
go.viam.com/rdk/rimage 77% 0.00%
go.viam.com/rdk/rimage/depthadapter 94% 0.00%
go.viam.com/rdk/rimage/transform 75% 0.00%
go.viam.com/rdk/rimage/transform/cmd/extrinsic_calibration 67% 0.00%
go.viam.com/rdk/robot 86% -0.91%
go.viam.com/rdk/robot/client 82% +0.19%
go.viam.com/rdk/robot/framesystem 65% 0.00%
go.viam.com/rdk/robot/impl 81% 0.00%
go.viam.com/rdk/robot/packages 80% 0.00%
go.viam.com/rdk/robot/server 53% 0.00%
go.viam.com/rdk/robot/web 64% 0.00%
go.viam.com/rdk/robot/web/stream 87% 0.00%
go.viam.com/rdk/services/baseremotecontrol 71% 0.00%
go.viam.com/rdk/services/baseremotecontrol/builtin 78% 0.00%
go.viam.com/rdk/services/datamanager 75% 0.00%
go.viam.com/rdk/services/datamanager/builtin 84% 0.00%
go.viam.com/rdk/services/datamanager/datacapture 73% 0.00%
go.viam.com/rdk/services/datamanager/datasync 0% 0.00%
go.viam.com/rdk/services/mlmodel 84% 0.00%
go.viam.com/rdk/services/mlmodel/tflitecpu 75% 0.00%
go.viam.com/rdk/services/motion 53% 0.00%
go.viam.com/rdk/services/motion/builtin 86% 0.00%
go.viam.com/rdk/services/navigation 54% 0.00%
go.viam.com/rdk/services/sensors 74% 0.00%
go.viam.com/rdk/services/sensors/builtin 97% 0.00%
go.viam.com/rdk/services/shell 25% 0.00%
go.viam.com/rdk/services/slam 84% 0.00%
go.viam.com/rdk/services/slam/builtin 74% 0.00%
go.viam.com/rdk/services/slam/fake 90% 0.00%
go.viam.com/rdk/services/slam/slam_copy/config 97% 0.00%
go.viam.com/rdk/services/slam/slam_copy/dataprocess 71% 0.00%
go.viam.com/rdk/services/slam/slam_copy/utils 100% 0.00%
go.viam.com/rdk/services/vision 79% 0.00%
go.viam.com/rdk/services/vision/builtin 73% 0.00%
go.viam.com/rdk/session 97% 0.00%
go.viam.com/rdk/spatialmath 84% 0.00%
go.viam.com/rdk/subtype 92% 0.00%
go.viam.com/rdk/utils 72% +0.18%
go.viam.com/rdk/vision 26% 0.00%
go.viam.com/rdk/vision/chess 80% 0.00%
go.viam.com/rdk/vision/delaunay 87% 0.00%
go.viam.com/rdk/vision/keypoints 92% 0.00%
go.viam.com/rdk/vision/objectdetection 82% 0.00%
go.viam.com/rdk/vision/odometry 60% 0.00%
go.viam.com/rdk/vision/odometry/cmd 0% 0.00%
go.viam.com/rdk/vision/segmentation 49% 0.00%
go.viam.com/rdk/web/server 26% 0.00%
Summary 66% (23202 / 35113) 0.00%

Copy link
Member

@nicksanford nicksanford left a comment

Choose a reason for hiding this comment

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

Approving given my review is no longer required
#2235 (comment)

@maximpertsov maximpertsov merged commit 1aa5246 into viamrobotics:main Apr 20, 2023
@maximpertsov maximpertsov deleted the RSDK-1979-motion branch October 23, 2023 17:38
bazile-clyde pushed a commit to bazile-clyde/rdk that referenced this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants