Skip to content

Commit c6b02d6

Browse files
author
marija-p
committed
Change parameter name for pose publisher
Add node shutdown on rosparam error
1 parent 934acfb commit c6b02d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gps_spoofer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GPSSpoofer:
1414
def __init__(self):
1515
# Parameters
1616
self.altitude_input = rospy.get_param('~altitude_input', 'vicon')
17-
self.pose_publisher = rospy.get_param('~publish_pose', True)
17+
self.publish_pose = rospy.get_param('~publish_pose', True)
1818

1919
# TODO: load params from param server
2020
self.max_R_noise = 0.0 # [m] max tested: 0.15
@@ -102,7 +102,7 @@ def callback_odometry(self, data):
102102
self.pwc.pose.pose.position.z = self.latest_altitude_message.data
103103
self.point.point.z = self.latest_altitude_message.data
104104
else:
105-
ROS_WARN("Unknown altitude input parameter")
105+
rospy.signal_shutdown("Unknown altitude input parameter")
106106

107107
if not self.got_odometry:
108108
print "GPSSpoofer: initializing timers"
@@ -127,7 +127,7 @@ def publish_noisy_positions(self, event):
127127
self.pwc.pose.pose.position.x += self.R_noise*cos(self.theta_noise)
128128
self.pwc.pose.pose.position.y += self.R_noise*sin(self.theta_noise)
129129

130-
if (self.pose_publisher == True):
130+
if (self.publish_pose == True):
131131
self.pub_disturbed_pose.publish(self.pwc)
132132

133133
self.point.point.x += self.R_noise*cos(self.theta_noise)

0 commit comments

Comments
 (0)