-
Notifications
You must be signed in to change notification settings - Fork 32
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
[WIP] Improved multilateration script #149
Conversation
@@ -57,50 +66,61 @@ class MultilaterationNode(object): | |||
except tf2_ros.TransformException, e: | |||
rospy.logwarn('TF Exception: {}'.format(e)) | |||
return | |||
if self.last_pos is not None and np.linalg.norm(self.last_pos - origin) < 0.2: |
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.
the 0.2
magic number should be a ROS param
if req.data is not self.enabled: | ||
self.vec_samples.clear() | ||
#if req.data is not self.enabled: | ||
# self.vec_samples.clear() |
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 remove dead code
self.heading_sub = rospy.Subscriber('/hydrophones/direction', | ||
Vector3Stamped, self.heading_cb, queue_size=10) | ||
self.position_pub = rospy.Publisher('/hydrophones/position', | ||
PointStamped, queue_size=1) | ||
self.enable_srv = rospy.Service('~enable', SetBool, | ||
self.enable_cb) | ||
self.reset_srv = rospy.Service('~reset', Trigger, | ||
self.reset_cb) |
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.
The txros interface should be changed to provide a function to call reset. I believe this was added at lakeday but not committed
Ap_sum += Ap | ||
|
||
return np.linalg.inv(A_sum).dot(Ap_sum) | ||
def ls_line_intersection2d(self, lines_array): |
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.
Just want to point out that what you're doing here (average of intersections of all possible pairs) yields a mathematically suboptimal estimate of the position of the source. Throwing out observations that are too close is sensible but swapping out least squares intersection for this average is not. Consider using this as a preprocessing step to filter the array of lines.
Messed up my git stuff, see #164 |
closes #148
Improved multilateration script
Needs testing on boat