-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1147 from knorth55/fetch-fix-nav
fix fetch robot localization and navigation (graft vs robot_localization is still under discussion; ZebraDevs/fetch_robots#56 )
- Loading branch information
Showing
6 changed files
with
180 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
jsk_fetch_robot/jsk_fetch_startup/scripts/imu_corrector.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python | ||
|
||
import rospy | ||
|
||
from sensor_msgs.msg import Imu | ||
|
||
|
||
class ImuCorrector(object): | ||
def __init__(self): | ||
super(ImuCorrector, self).__init__() | ||
self.sub = rospy.Subscriber( | ||
'~input', Imu, self._cb, queue_size=1) | ||
self.pub = rospy.Publisher( | ||
'~output', Imu, queue_size=1) | ||
|
||
def _cb(self, msg): | ||
msg.header.frame_id = 'base_link' | ||
msg.angular_velocity_covariance = [0, 0, 0, | ||
0, 0, 0, | ||
0, 0, 4e-6] | ||
self.pub.publish(msg) | ||
|
||
|
||
if __name__ == '__main__': | ||
rospy.init_node('imu_corrector') | ||
app = ImuCorrector() | ||
rospy.spin() |
31 changes: 31 additions & 0 deletions
31
jsk_fetch_robot/jsk_fetch_startup/scripts/odom_corrector.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python | ||
|
||
import rospy | ||
|
||
from nav_msgs.msg import Odometry | ||
|
||
|
||
class OdomCorrector(object): | ||
def __init__(self): | ||
super(OdomCorrector, self).__init__() | ||
self.sub = rospy.Subscriber( | ||
'~input', Odometry, self._cb, queue_size=1) | ||
self.pub = rospy.Publisher( | ||
'~output', Odometry, queue_size=1) | ||
self.covariance = [1e-3, 0, 0, 0, 0, 0, | ||
0, 1e-3, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, | ||
0, 0, 0, 0, 0, 1e-3] | ||
|
||
def _cb(self, msg): | ||
msg.pose.covariance = self.covariance | ||
msg.twist.covariance = self.covariance | ||
self.pub.publish(msg) | ||
|
||
|
||
if __name__ == '__main__': | ||
rospy.init_node('odom_corrector') | ||
app = OdomCorrector() | ||
rospy.spin() |