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

Unify observer branches #11

Open
marioney opened this issue Mar 29, 2021 · 5 comments
Open

Unify observer branches #11

marioney opened this issue Mar 29, 2021 · 5 comments

Comments

@marioney
Copy link
Member

We have two branches now safety_observer and observers

I'm not sure what are the differences, but I guess we should merge them.

@ipa-hsd any comments?

@hsd-dev
Copy link
Collaborator

hsd-dev commented Mar 29, 2021

Can you check this commit? Seems like you added the script, not sure if it is still needed.

@marioney
Copy link
Member Author

No, I don't think we need that script anymore.

I'm not even sure why I created that script. In any case the reasoner should decide when an objective is in error.

@hsd-dev
Copy link
Collaborator

hsd-dev commented Mar 29, 2021

Apart from that script, the calculation of safety QA is different. In observers branch it is:

def calculate_attr(self, msgs):
status_msg = DiagnosticStatus()
vel_x = msgs[0].twist.twist.linear.x
vel_y = msgs[0].twist.twist.linear.y
velocity = sqrt(vel_x ** 2 + vel_y ** 2)
## We assume a max acceleration of 1 m/s^2
## The minimum value
d_break = (velocity)/(0.4)
# print (d_break)
normalized_safety=1.0
if (d_break > msgs[2].data):
normalized_safety = msgs[2].data/d_break
#print ("d_break: {0}".format(d_break))
#print("disntace:{0}".format(msgs[2].data))
print("normalized safety:{0}".format(normalized_safety))
status_msg = DiagnosticStatus()
status_msg.level = DiagnosticStatus.OK
status_msg.name = self._id
status_msg.values.append(
KeyValue("safety", str(normalized_safety)))
status_msg.message = "QA status"

@marioney
Copy link
Member Author

Apart from that script, the calculation of safety QA is different. In observers branch it is:

I guess those changes need to stay, I'm not sure why I made those, but that's the version we used for the experiments

@hsd-dev
Copy link
Collaborator

hsd-dev commented Mar 30, 2021

I guess those changes need to stay

OK in that case, we can cherry-pick that commit into safety_observer branch and delete observers branch.

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

No branches or pull requests

2 participants