-
Notifications
You must be signed in to change notification settings - Fork 58
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
Camera: configure projection matrix from SDFormat #249
Camera: configure projection matrix from SDFormat #249
Conversation
Signed-off-by: Brian Chen <[email protected]>
Signed-off-by: Brian Chen <[email protected]>
<< " <p_fx>282</p_fx>" | ||
<< " <p_fy>283</p_fy>" | ||
<< " <p_cx>163</p_cx>" | ||
<< " <p_cy>125</p_cy>" | ||
<< " <tx>1</tx>" | ||
<< " <ty>2</ty>" |
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.
Can we check that the parsing / setting of values was successful here ?
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.
If I am not mistaken this is already done in the test here:
Lines 123 to 130 in 6b1acb9
sdf::SDFPtr sdfParsed(new sdf::SDF()); | |
sdf::init(sdfParsed); | |
if (!sdf::readString(stream.str(), sdfParsed)) | |
return sdf::ElementPtr(); | |
return sdfParsed->Root()->GetElement("model")->GetElement("link") | |
->GetElement("sensor"); | |
} |
sdf::readString
will return False if parsing was unsuccessful so the test should fail if the test is unsuccessful. One change that can be made is to check for the errors like this, but it's a little redundant since the return bool already tells us if it failed or not
sdf::Errors errors;
if (!sdf::readString(stream.str(), sdfParsed, errors)){
ASSERT_EQ(errors.size(), 0);
return sdf::ElementPtr();
}
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 does check that it did not fail during parsing but doesn't confirm that the values are correct. I don't see a test where this is already done, so I'll see if there's an easy way to add this; if not we can merge as is
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've added some tests for the new parameters in 9c8f428
Signed-off-by: Brian Chen <[email protected]>
I'll make a prerelease of sdformat9 to support this ticket |
|
rerunning CI since sdformat 9.9.0 was released |
Codecov Report
@@ Coverage Diff @@
## ign-sensors3 #249 +/- ##
=============================================
Coverage 79.80% 79.80%
=============================================
Files 23 23
Lines 2377 2377
=============================================
Hits 1897 1897
Misses 480 480
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
this is ready for review |
Confirm that intrinsics and projection parameters in CameraInfo message match the values from SDFormat. Signed-off-by: Steve Peters <[email protected]>
Load plugins from build folder instead of the install prefix. Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
🎉 New feature
Summary
This PR adds sdf fields to allow for configuration of the camera projection matrix.
Related PR in sdf9: gazebosim/sdformat#1088
Test it
Make a camera with those fields
Checklist
codecheck
passed (See contributing)