-
Notifications
You must be signed in to change notification settings - Fork 117
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
base: main
Are you sure you want to change the base?
RSDK-10574 #4964
Conversation
Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!
|
There was a problem hiding this 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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
components/arm/fake/fake.go
Outdated
@@ -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") |
There was a problem hiding this comment.
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
components/arm/universalrobots/ur.go
Outdated
@@ -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") |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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!") |
There was a problem hiding this comment.
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.
No description provided.