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-7904] Remove status and streaming status from robot interface #4461

Merged

Conversation

randhid
Copy link
Member

@randhid randhid commented Oct 18, 2024

Since this API is deprecated, I am doing some cleaning and removing it from component registrations.
Manually tested with a Mac viam-server and fake components that change their state, control card still works.
This breaks the local rc card, so I may wait until that is updated until I merge this.

Still to do:

  • Manual tests on a raspberry pi.

@randhid randhid requested a review from cheukt October 18, 2024 14:36
Copy link
Contributor

Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!

component function
base IsMoving
board GPIOPinByName
camera Properties
encoder Properties
motor IsMoving
sensor Readings
servo Position
arm EndPosition
audio MediaProperties
gantry Lengths
gripper IsMoving
input_controller Controls
movement_sensor LinearAcceleration
power_sensor Power
pose_tracker Poses
motion GetPose
vision GetProperties

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Oct 18, 2024
@cheukt
Copy link
Member

cheukt commented Oct 18, 2024

ya we should only remove it when local rc no longer relies on this

@randhid
Copy link
Member Author

randhid commented Nov 5, 2024

Waiting on #4520 to be merged in.

@randhid randhid force-pushed the 20241017-remove-status-from-components branch from 69f606c to 34ee30f Compare November 22, 2024 20:06
@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 Nov 22, 2024
@cheukt
Copy link
Member

cheukt commented Nov 26, 2024

are we removing it in the api repo too?

@randhid
Copy link
Member Author

randhid commented Nov 26, 2024

are we removing it in the api repo too?

Not in this pr, I don't want to do an API break - that's too much sdk work plus I have no clue if you guys still use last_reconfigured from it.

@randhid randhid force-pushed the 20241017-remove-status-from-components branch from 5000643 to 2d24130 Compare December 2, 2024 22:44
@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 Dec 2, 2024
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Dec 4, 2024
@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 Dec 4, 2024
@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 Dec 4, 2024
@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 Dec 4, 2024
robot/web/web_test.go Outdated Show resolved Hide resolved
robot/client/client_test.go Outdated Show resolved Hide resolved
@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 Dec 5, 2024
@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 Dec 5, 2024
@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 Dec 6, 2024
@randhid randhid changed the title [RSDK-7904] Remove status from components [RSDK-7904] Remove status and streaming status from robot interface Dec 6, 2024
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.

some minor changes, but looks good to go! thanks for doing this

}

conn, err := rgrpc.Dial(context.Background(), addr, logger,
rpc.WithWebRTCOptions(rpc.DialWebRTCOptions{Disable: true}))
test.That(t, err, test.ShouldBeNil)
client := robotpb.NewRobotServiceClient(conn)

// Use GetStatus and a context with a deadline to call injected status function.
// // Use GetMachineStatus and a context with a deadline to call injected status function.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// // Use GetMachineStatus and a context with a deadline to call injected status function.
// Use GetMachineStatus and a context with a deadline to call injected status function.

Comment on lines 1292 to 1293
// // Use an injected status function to check that the default deadline was not
// // added to the context, and the deadline passed to GetMachineStatus was used instead.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// // Use an injected status function to check that the default deadline was not
// // added to the context, and the deadline passed to GetMachineStatus was used instead.
// Use an injected status function to check that the default deadline was not
// added to the context, and the deadline passed to GetMachineStatus was used instead.

Comment on lines 527 to 529
statuses, err = r2.MachineStatus(context.Background())
test.That(t, err, test.ShouldBeNil)
test.That(t, len(statuses), test.ShouldEqual, 1)

armStatus := &armpb.Status{
EndPosition: &commonpb.Pose{X: 500, Z: 300, OZ: 1},
JointPositions: &armpb.JointPositions{Values: []float64{0.0}},
}
convMap := &armpb.Status{}
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{TagName: "json", Result: &convMap})
test.That(t, err, test.ShouldBeNil)
err = decoder.Decode(statuses[0].Status)
test.That(t, err, test.ShouldBeNil)
test.That(t, convMap, test.ShouldResemble, armStatus)
test.That(t, statuses, test.ShouldNotBeNil)
Copy link
Member

Choose a reason for hiding this comment

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

can probably straight up delete these lines

robot/impl/local_robot_test.go Outdated Show resolved Hide resolved
@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 Dec 9, 2024
@randhid randhid requested a review from cheukt December 9, 2024 19:37
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

@randhid randhid merged commit 3f1a3b6 into viamrobotics:main Dec 11, 2024
16 checks passed
@randhid randhid deleted the 20241017-remove-status-from-components branch December 12, 2024 02:14
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.

3 participants