Skip to content

Make the failure test more like the old one. - #19

Merged
clalancette merged 1 commit into
ros2from
fix-buffer-core-test
Apr 27, 2017
Merged

clalancette merged 1 commit into
ros2from
fix-buffer-core-test

Conversation

@clalancette

Copy link
Copy Markdown
Contributor

While we fixed the earlier errors, we changed the nature of
what the test was testing. This change makes it so that
we are testing the same code paths as previously.

Signed-off-by: Chris Lalancette [email protected]

While we fixed the earlier errors, we changed the nature of
what the test was testing.  This change makes it so that
we are testing the same code paths as previously.

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette clalancette added the in progress Actively being worked on (Kanban column) label Apr 25, 2017
@clalancette

clalancette commented Apr 25, 2017 •

Copy link
Copy Markdown
Contributor Author

After this commit, the "setTransformFail" test looks like this:

3: [ RUN      ] tf2.setTransformFail
3: Error:   TF_SELF_TRANSFORM: Ignoring transform from authority "authority1" with frame_id and child_frame_id  "" because they are the same
3:          at line 235 in /home/clalancette/ros2_ws/src/ros2/geometry2/tf2/src/buffer_core.cpp
3: Error:   TF_NO_CHILD_FRAME_ID: Ignoring transform from authority "authority1" because child_frame_id not set 
3:          at line 241 in /home/clalancette/ros2_ws/src/ros2/geometry2/tf2/src/buffer_core.cpp
3: Error:   TF_NO_FRAME_ID: Ignoring transform with child_frame_id ""  from authority "authority1" because frame_id not set
3:          at line 247 in /home/clalancette/ros2_ws/src/ros2/geometry2/tf2/src/buffer_core.cpp
3: Error:   TF_NAN_INPUT: Ignoring transform for child_frame_id "" from authority "authority1" because of a nan value in the transform (0.000000 0.000000 0.000000) (-nan -nan -nan -nan)
3:          at line 258 in /home/clalancette/ros2_ws/src/ros2/geometry2/tf2/src/buffer_core.cpp
3: Error:   TF_DENORMALIZED_QUATERNION: Ignoring transform for child_frame_id "" from authority "authority1" because of an invalid quaternion in the transform (-nan -nan -nan -nan)
3:          at line 271 in /home/clalancette/ros2_ws/src/ros2/geometry2/tf2/src/buffer_core.cpp
3: [       OK ] tf2.setTransformFail (0 ms)

@clalancette

Copy link
Copy Markdown
Contributor Author

CI:
windows: Build Status
linux: Build Status
linux aarch64: Build Status
osx: Build Status

@dhood

dhood commented Apr 25, 2017

Copy link
Copy Markdown
Member

For reference here's the output of an upstream job again (http://build.ros.org/job/Ipr__geometry2__ubuntu_trusty_amd64/83/consoleFull search for setTransformFail):

16:02:56 [----------] 3 tests from tf2
16:02:56 [ RUN      ] tf2.setTransformFail
16:02:56 Error:   TF_SELF_TRANSFORM: Ignoring transform from authority "authority1" with frame_id and child_frame_id  "" because they are the same
16:02:56          at line 220 in /tmp/catkin_workspace/src/geometry2/tf2/src/buffer_core.cpp
16:02:56 Error:   TF_NO_CHILD_FRAME_ID: Ignoring transform from authority "authority1" because child_frame_id not set 
16:02:56          at line 226 in /tmp/catkin_workspace/src/geometry2/tf2/src/buffer_core.cpp
16:02:56 Error:   TF_NO_FRAME_ID: Ignoring transform with child_frame_id ""  from authority "authority1" because frame_id not set
16:02:56          at line 232 in /tmp/catkin_workspace/src/geometry2/tf2/src/buffer_core.cpp
16:02:56 Error:   TF_DENORMALIZED_QUATERNION: Ignoring transform for child_frame_id "" from authority "authority1" because of an invalid quaternion in the transform (0.000000 0.000000 0.000000 0.000000)
16:02:56          at line 256 in /tmp/catkin_workspace/src/geometry2/tf2/src/buffer_core.cpp

There's still an additional error in our case which may or may not be significant. Do you happen to know why the TF_NAN_INPUT error comes about?

@clalancette

Copy link
Copy Markdown
Contributor Author

So, in the outputs you pasted, we were somehow getting all zeros into the quaternion, which was causing the last error message. In the new code, I set the inputs to the quaternion to all zeros, which causes the quaternion itself to be all -nan. I can't say I understand the math of quaternions, so I'm not exactly sure why that is.

That being said, the new code actually tests slightly more code paths. We now hit the isnan() checks (which causes the first error), then we hit the invalid quaternion checks (the second error). The difference is that we aren't actually testing whether a non-nan quaternion is invalid, but that doesn't quite seem to be the point of this test. Let me know if you think otherwise, and I can try to figure out more quaternion math to make it more like the old one.

@clalancette clalancette added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Apr 25, 2017
@dhood

dhood commented Apr 26, 2017

Copy link
Copy Markdown
Member

We still need to make sure that the additional failing isnan() check is a reasonable thing though.

From what I've seen, the zero-quaternion msg gets passed through to a tf2::Quaternion here. In the ros2 version of tf2, we call getRotation().x() on that quaternion, while ros1 tf2 just accesses it directly.

That would explain why we get the nan result, so I'd consider this expected behaviour.

@clalancette

Copy link
Copy Markdown
Contributor Author

Actually, I think this whole thing would be better served by having separate tests for each of the error paths, and then having some tests which have combinations of errors. However, that is an upstream type fix. I'll eventually open a PR for that in upstream geometry2.

@clalancette

Copy link
Copy Markdown
Contributor Author

And thanks for the review :). I'm merging this.

@clalancette
clalancette merged commit d20b837 into ros2 Apr 27, 2017
@clalancette
clalancette deleted the fix-buffer-core-test branch April 27, 2017 14:45
@clalancette clalancette removed the in review Waiting for review (Kanban column) label Apr 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants