Skip to content

RSDK-10574 #4964

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

RSDK-10574 #4964

wants to merge 4 commits into from

Conversation

nicksanford
Copy link
Member

No description provided.

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label May 1, 2025
Copy link
Contributor

github-actions bot commented May 1, 2025

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

Copy link
Member

@raybjork raybjork left a comment

Choose a reason for hiding this comment

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

General shape looks right. For the implementations of Kinematics we should be doing the same thing as was done in the ModelFrame functions

@@ -13,6 +13,7 @@ import (
rprotoutils "go.viam.com/rdk/protoutils"
"go.viam.com/rdk/referenceframe"
"go.viam.com/rdk/resource"
"go.viam.com/rdk/robot/framesystem"
Copy link
Member

Choose a reason for hiding this comment

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

I don't like the addition of a dependency on the framesystem. Lets move the ParseKinematicsResponse to the referenceframe package and rename to something like KinematicModelFromProtobuf or NewModelFromProtobuf

Copy link
Member Author

Choose a reason for hiding this comment

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

the urdf model depends on referenceframe.

I can't move KinematicModelFromProtobuf into referenceframe without causing a cycle.

@@ -218,6 +218,10 @@ func (a *Arm) IsMoving(ctx context.Context) (bool, error) {
return false, nil
}

func (a *Arm) Kinematics(ctx context.Context) (referenceframe.Frame, error) {
return nil, errors.New("fake arm.Kinematics is unimplemented")
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if you are leaving unimplemented because you don't want to do this in this PR but in this case its super easy we just need to return a.model, utiizing the mutext appropriately of course

@@ -509,6 +510,10 @@ func (ua *urArm) moveToJointPositionRadians(ctx context.Context, radians []float
}
}

func (ua *urArm) Kinematics(ctx context.Context) (referenceframe.Frame, error) {
return nil, errors.New("urArm arm.Kinematics is unimplemented")
Copy link
Member

Choose a reason for hiding this comment

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

Same thing here, the implementation is super simple, just the same thing we are doing in the ModelFrame function

@@ -132,14 +131,6 @@ func TestClient(t *testing.T) {
test.That(t, spatialmath.GeometriesAlmostEqual(expectedGeometries[i], geometry), test.ShouldBeTrue)
}

m := gripper1Client.ModelFrame()
Copy link
Member

Choose a reason for hiding this comment

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

Unless theres a reason to remove this lets keep it. We can swap the call to ModelFrame to a call to Kinematics

}

func (c *client) CurrentInputs(ctx context.Context) ([]referenceframe.Input, error) {
c.logger.Warn("gripper.CurrentInputs is unimplemented!")
Copy link
Member

Choose a reason for hiding this comment

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

Reminder to self to think about this more.

@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 May 2, 2025
@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 May 2, 2025
@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 May 2, 2025
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