-
Notifications
You must be signed in to change notification settings - Fork 111
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-628 - allow configurable kinematics for fake arm models #1432
Conversation
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.
Looks good! I like the simplification down to just fake
.
@@ -145,19 +146,19 @@ func TestFrameSystemFromConfig(t *testing.T) { | |||
|
|||
// There is a point at (1500, 500, 1300) in the world referenceframe. See if it transforms correctly in each referenceframe. | |||
worldPose := referenceframe.NewPoseInFrame(referenceframe.World, spatialmath.NewPoseFromPoint(r3.Vector{1500, 500, 1300})) | |||
armPt := r3.Vector{0, 0, 500} | |||
armPt := r3.Vector{500, 0, 0} |
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.
Is there a place we can check where these values are coming from?
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.
Unfortunately not really, this was all hand calculated. But you can see the kinematic information in fake_model.json
. Does this answer your question?
return fakearm.NewArmIK(ctx, config.Component{Name: "arm"}, logger) | ||
return fakearm.NewArm(ctx, config.Component{ | ||
Name: arm.Subtype.String(), | ||
ConvertedAttributes: &fakearm.AttrConfig{ArmModel: xarm.ModelName(6)}, |
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 assume this change is so that this test can use the kinematic model of the xArm6?
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.
Yes, before it was using another fake kinematic model, which no longer exists
func NewArm(ctx context.Context, cfg config.Component, logger golog.Logger) (arm.LocalArm, error) { | ||
var model referenceframe.Model | ||
var err error | ||
if cfg.ConvertedAttributes != nil { |
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.
Probably we should also allow the use of arbitrary files similar to wrapper
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.
yes probably, but this is work that I don't think is necessary now, so I would like to push it to another PR
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.
Just a couple small changes, and one thing to think about, other than that looks good
|
||
// AttrConfig is used for converting config attributes. | ||
type AttrConfig struct { | ||
FailNew bool `json:"fail_new"` |
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 think this should also be removed, no?
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.
This is still being used in some tests, so I wasn't inclined to take it out. Thoughts?
// Validate ensures all parts of the config are valid. | ||
func (config *AttrConfig) Validate(path string) error { | ||
if config.FailNew { | ||
return errors.New("whoops") |
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.
This too
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.
LGTM
|
Currently there is no way to specify what kinematic model a fake arm which makes it difficult to test motion planning for arms that we are not connected to. Additionally, the fake and fakeIK models both exist in the codebase which is confusing. This PR addresses both these concerns by wrapping fakeIK model functionality into the fake model, and further makes the kinematic model for the fake model configurable.