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

Optical Tactile Sensor Plugin #229

Merged
merged 33 commits into from
Dec 12, 2020

Conversation

mcres
Copy link
Contributor

@mcres mcres commented Jun 26, 2020

Optical Tactile Sensor Plugin for GSoC 2020.

It retrieves the contacts given by a contact sensor and computes the normal surfaces of an object given the data returned by a Depth Camera. It also visualizes these forces in a similar way as Gazebo Classic, so this PR partially addresses #112.

Future work will be focused on:

  • Tutorial explaining the plugin.
  • Computation performance.
  • Merging the data returned by contact and camera sensors.

out2

mcres added 14 commits June 4, 2020 15:37
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
@mcres mcres requested a review from chapulina as a code owner June 26, 2020 12:09
@mcres
Copy link
Contributor Author

mcres commented Jun 26, 2020

CC @mabelzhang

@chapulina chapulina added the 🔮 dome Ignition Dome label Jun 30, 2020
Copy link
Contributor

@mabelzhang mabelzhang left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! I did a first pass. Mostly performance comments and style. Some of the style comments you should see if you run a linter. colcon test --packages-select ignition-gazebo4 probably has some. The checks at the bottom of the PR should also tell you style problems. If you click on the fail ones, they should take you to Jenkins and give you the diffs of new style errors.

examples/worlds/optical_tactile_sensor_plugin.sdf Outdated Show resolved Hide resolved
src/systems/optical_tactile_plugin/OpticalTactilePlugin.hh Outdated Show resolved Hide resolved
src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc Outdated Show resolved Hide resolved
src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc Outdated Show resolved Hide resolved
src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc Outdated Show resolved Hide resolved
src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc Outdated Show resolved Hide resolved
src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc Outdated Show resolved Hide resolved
src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc Outdated Show resolved Hide resolved
mcres added 3 commits July 9, 2020 11:46
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
@chapulina
Copy link
Contributor

@mabelzhang / @azeey : both of you have requests for changes. Would it be possible to do another review? Thanks!

@mabelzhang
Copy link
Contributor

Looks like this comment is unresolved: #229 (comment)
Mac CI is still failing.
Those are the only remaining things for this PR.

@mabelzhang
Copy link
Contributor

@osrf-jenkins run tests

@mabelzhang
Copy link
Contributor

Mac CI has a new warning https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-homebrew-amd64/3994/

OpticalTactilePlugin.cc:529
expression result unused

That should be an easy fix.

Test failures:
ServerRepeat/DiffDriveTest.PublishCmdCustomTopics/0
ServerRepeat/DiffDriveTest.SkidPublishCmd/0
INTEGRATION_physics_system.test_ran

@chapulina are these flakey by any chance? The reference build 3993 has a different set of failing tests, so I can't really tell. Looks like the badge linked from osrf/buildfarmer has yet a different set of failing tests ha...

@mabelzhang
Copy link
Contributor

Ah, cool, took me a few minutes to figure out the correct order to click on History to get to those pages you linked. Nice graphs. Jenkins could use better UI.

Ubuntu CI has one failure,
ContactSystemTest.MultipleCollisionsAsContactSensors, but looks like it's failed once before
https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/4316/testReport/(root)/ContactSystemTest/MultipleCollisionsAsContactSensors/history/

@mabelzhang
Copy link
Contributor

@osrf-jenkins run tests

@mabelzhang
Copy link
Contributor

Grabbing the results before Jenkins shuts down today.

Ubuntu CI:
https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/4319/
Test Result (2 failures / +1)
ContactSystemTest.MultipleCollisionsAsContactSensors
EntityComponentManagerPerfrormance.Each

I am not sure if the ContactSystem test came from this PR... I saw another failure before 4316, and I think the earlier one is not from this PR. I didn't write down the number.

/var/lib/jenkins/workspace/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/ign-gazebo/test/integration/contact_system.cc:118
Value of: contactMsgs.size()
  Actual: 3
Expected: 0u
Which is: 0

Mac CI:
https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-homebrew-amd64/3997/
There's a seg fault still.
Test Result (2 failures / +1)
PeerTracker.PeerTrackerStale
UNIT_Server_TEST.test_ran

So looks like the ones from 3994 above were flaky.
These new ones did not fail in 3994. PeerTrackerStale failed for both 3997 and 3998. So these look flaky.

Signed-off-by: Mabel Zhang <mabel@openrobotics.org>
Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

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

LGTM! Left just a couple of minor comments. Feel free to address them in the follow up PR.

_normalForce * this->forceLength, normalForceOrientationFromSensor);

normalForcePoseFromWorld =
(normalForcePoseFromSensor + this->depthCameraOffset) + _sensorWorldPose;
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using Pose3f::operator* instead of Pose3f::operator+ since the latter is discouraged. If you do, note that you'll have to swap the order of operations


//////////////////////////////////////////////////
OpticalTactilePluginVisualization::OpticalTactilePluginVisualization(
std::string &_modelName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these be const refs?

@mabelzhang
Copy link
Contributor

ignition_gazebo-ci-pr_any-homebrew-amd64 is still reporting some failures:

The following tests FAILED:
	 79 - INTEGRATION_joint_state_publisher_system (SEGFAULT)
	 83 - INTEGRATION_level_manager (Subprocess aborted)

The first one I don't see anywhere else.

Related to the second one, level manager had some related failures, on
LevelManagerPerfrormance.LevelVsNoLevel https://build.osrfoundation.org/job/ignition_gazebo-ci-ign-gazebo4-homebrew-amd64/4/
and INTEGRATION_level_manager_runtime_performers.test_ran https://build.osrfoundation.org/job/ignition_gazebo-ci-ign-gazebo4-homebrew-amd64/3/

ignition_gazebo-ci-pr_any-ubuntu_auto-amd64's 2 out of 3 failures are expected (LogSystemTest.LogResources and SdfInclude.DownloadFromFuel).
This one failed but shouldn't: ServerRepeat/VelocityControlTest.PublishCmd/0

However, seeing that all the code changes in this PR are strictly within a new directory src/systems/optical_tactile_plugin, I really don't think it should affect any of the tests at all...
Will rerun and see if these fail again.

@mabelzhang
Copy link
Contributor

@osrf-jenkins run tests

@mabelzhang
Copy link
Contributor

Alright, those two on homebrew-amd64 were flaky. Not failing on the rerun. Rerun fails on INTEGRATION_breadcrumbs which is flaky.

ubuntu_auto-amd64 still failing on ServerRepeat/VelocityControlTest.PublishCmd/0, which is unexpected.
Looks like it could be a precision problem, but it's not comparing >=, it wants >.

123: /var/lib/jenkins/workspace/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/ign-gazebo/test/integration/velocity_control_system.cc:128: Failure
123: Expected: (poses[i].Pos().X()) > (poses[i-1].Pos().X()), actual: 2.12913e-10 vs 2.13556e-10
123: /var/lib/jenkins/workspace/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/ign-gazebo/test/integration/velocity_control_system.cc:129: Failure
123: Expected: (poses[i].Pos().Y()) > (poses[i-1].Pos().Y()), actual: 2 vs 2

However, the previous run had 4 unexpected comparison outcomes, the latest one only has 2. So it could just be flaky.
I will rerun one more time to be careful.

@mabelzhang
Copy link
Contributor

@osrf-jenkins run tests

@mabelzhang
Copy link
Contributor

It looks like ServerRepeat/VelocityControlTest.PublishCmd/0 on ubuntu_auto-amd64 is really failing just for this PR. All other tests are passing. Need to look into it.

@mabelzhang
Copy link
Contributor

Huh, that test is failing elsewhere too
https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/4751/testReport/
https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/4752/testReport/
https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/4755/testReport/

I think it's flaky.
That is the last test failure. I'm ready to approve this. Might wait for a few more runs on this test to see if it fails more to be sure.

@mabelzhang
Copy link
Contributor

I looked again, the 3 failures of the same test above come from 3 different PRs, so it's definitely flaky. Merging this.

@mabelzhang mabelzhang merged commit 05e2ff6 into gazebosim:ign-gazebo4 Dec 12, 2020
@adlarkin
Copy link
Contributor

@mabelzhang was this just a regular merge? It looks like we forgot to squash the PR into one commit before merging. Here's the diff between ign-gazebo4 and a branch I created just before thus was merged: adlarkin/4.1.0...ign-gazebo4

@adlarkin adlarkin mentioned this pull request Dec 14, 2020
@mabelzhang
Copy link
Contributor

Yes just a regular merge, sorry I wasn't sure what was the preferred method of merge and just went with the default. Noted for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants