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

rework groundtruth handling #150

Merged
merged 10 commits into from
Oct 28, 2020
Merged

rework groundtruth handling #150

merged 10 commits into from
Oct 28, 2020

Conversation

floweisshardt
Copy link
Owner

No description provided.

@floweisshardt floweisshardt changed the title check details of user_result rework groundtruth handling Sep 30, 2020
rospy.loginfo("no user result set for testblock \'%s\'"%testblock)
rospy.logwarn("no user result set for testblock \'%s\'"%testblock)
metric_result = MetricResult()
metric_result.groundtruth.error_message = "!!USER ERROR!!: no user result set for testblock %s"%testblock # TODO use from global field (same as in atf.stop())
Copy link
Collaborator

Choose a reason for hiding this comment

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

actually, I think we do not need to set the message via a global field
because if you set the result to false, then this us a valid MetricResult which will show up as properfailure during analysis phase...


metric_result.data = self.metric_result.data
# check if result is available
if metric_result.groundtruth.error_message.startswith("!!USER ERROR!!: no user result set"): # TODO use from global field (same as in atf.stop())
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think we need this block because in this case, metric_result is already sufficiently filled (see my comment above) and will correctly be handled as any other case where result is set to false...right?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'm still in favor of keeping this block as it gives a different failure reason. I calling atf.stop() without user result we se the following failure reasons:

without this block

Failed ATF tests:
 - test 'ts0_c0_r0_e0_s0_0' (test1, robot1, env1, testblockset1): 
   - testblock 'testblock_5s': 
     - metric 'user_result::0': groundtruth missmatch: 0.000000 not within 0.800000+-0.200000

with this block

Failed ATF tests:
 - test 'ts0_c0_r0_e0_s0_0' (test1, robot1, env1, testblockset1): 
   - testblock 'testblock_5s': 
     - metric 'user_result::0': testblock testblock_5s stopped without user_result

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm asking myself now why result and error_message are part of the Groundtruth.msg and not directly under MetricResult.msg

with your explanations from yesterday, I now understand groundtruth is rather optional and contains only the "target" value and the epsilon range

having result and error_message in Groundtruth.msg doesn't seem to make too much sense

I rather think those two fields should be put (on level up) into MetricResult directly
as result and error_message are not necessarily groundtruth-related but are mandatory (at least result) also for metrics that do NOT use groundtruth

if you then would chose uint8 (together with some enums) for result instead of bool - or even actionlib_msgs.GoalStatus directly, then the default value means something PENDING/UNINITIALIZED/NOT_SET and would make it easier to distinguish result not being set from result being negative/failure or positive/success

so any metric would not try to set the value of metric_result.groundtruth.result but rather metric_result.result - or whatever the field is called then

we can continue yesterday's discussion in another daily if you like

Copy link
Collaborator

@fmessmer fmessmer left a comment

Choose a reason for hiding this comment

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

this is just a scroll-through review....most comment apply to several files and multiple appearances within each file but are only commented once...

in particular you might want to find all occurrences of:

  • active, started and finished :point_right: should be removed and replaced by status` enum
  • groundtruth_result or groundtruth.result and make sure they are not involved in boolean operations (i.e. True/False assign or boolean operator without ==/!=) and replace them accordingly to the status Groundtruth result enum

atf_core/scripts/analyser.py Outdated Show resolved Hide resolved
atf_core/src/atf_core/testblock.py Outdated Show resolved Hide resolved
atf_core/src/atf_core/testblock.py Outdated Show resolved Hide resolved
atf_plotter/scripts/plot.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@fmessmer fmessmer left a comment

Choose a reason for hiding this comment

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

you also might want to have a branch that introduces pylint checks!

create it on top of this branch

even if it doesn't pass, it's nice to get some hints and possibly fix some easy issues
until full pylint compatibility is achieved that branch can be rebased continuosuly...

@floweisshardt
Copy link
Owner Author

FYI: pylint is activated in #152

Copy link
Collaborator

@fmessmer fmessmer left a comment

Choose a reason for hiding this comment

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

atf_metrics.calculate_distance_to_obstacles is not conform with the way the other metrics are implemented and still uses started, finished etc. boolean logic - should either be adjusted or removed

same for atf_metrics.calculate_resources!

@floweisshardt
Copy link
Owner Author

atf_metrics.calculate_distance_to_obstacles is not conform with the way the other metrics are implemented and still uses started, finished etc. boolean logic - should either be adjusted or removed

same for atf_metrics.calculate_resources!

those are unsupported metrics. I removed them in #155 and created a backup branch https://github.com/floweisshardt/atf/tree/feature/old_metrics if we want to reanimate them sometime.

@floweisshardt
Copy link
Owner Author

@fmessmer I'd suggest to merge this PR and not wait for the pylint fixes in #153.

I'll add temporary commits to use this feature branch in

@fmessmer
Copy link
Collaborator

if the metrics are removed in #155, this PR should get rebased on top of floweisshardt/atf#master

@floweisshardt
Copy link
Owner Author

PR is now rebased on floweisshardt/master

@floweisshardt floweisshardt merged commit 9eff3e4 into master Oct 28, 2020
@floweisshardt floweisshardt deleted the fix/user_result branch November 1, 2020 13:52
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