gen.add("range_sensor_clip", bool_t, 0, "Clip range sensor values to max range", True)
gen.add("range_sensor_max", double_t, 0, "Range sensor max range", 0.5, 0.04, 4)
+gen.add("range_sensor_fov", double_t, 0, "Range sensor field of view (deg)", 30, 1, 90)
gen.add("odom_covar_xy", double_t, 0, "Odometry covariance: translation", 1e-3, 1e-6, 1)
gen.add("odom_covar_angle", double_t, 0, "Odometry covariance: rotation", 1.00, 1e-6, 6.2832)
gen.add("rollover_protect", bool_t, 0, "Enable motor rollover protection on pitch", True)
def execute_dyn_reconf(self, config, level):
self.bClipRangeSensor = config["range_sensor_clip"]
self.range_sensor_max = config["range_sensor_max"]
+ self.range_sensor_fov = config["range_sensor_fov"]
self.odom_covar_xy = config["odom_covar_xy"]
self.odom_covar_angle = config["odom_covar_angle"]
self.rollover_protect = config["rollover_protect"]
def get_dist_forward_left(self):
if self.pub_range_fwd_left.get_num_connections() > 0:
dist = self.read_dist_srf(0x15)
- self.send_range(self.pub_range_fwd_left, "sonar_forward_left", Range.ULTRASOUND, dist, 0.04, self.range_sensor_max, 30)
+ self.send_range(self.pub_range_fwd_left, "sonar_forward_left", Range.ULTRASOUND, dist, 0.04, self.range_sensor_max, self.range_sensor_fov)
def update_dist_forward_left(self):
if self.pub_range_fwd_left.get_num_connections() > 0:
def get_dist_backward(self):
if self.pub_range_bwd.get_num_connections() > 0:
dist = self.read_dist_srf(0x17)
- self.send_range(self.pub_range_bwd, "sonar_backward", Range.ULTRASOUND, dist, 0.04, self.range_sensor_max, 30)
+ self.send_range(self.pub_range_bwd, "sonar_backward", Range.ULTRASOUND, dist, 0.04, self.range_sensor_max, self.range_sensor_fov)
def update_dist_backward(self):
if self.pub_range_bwd.get_num_connections() > 0:
def get_dist_forward_right(self):
if self.pub_range_fwd_right.get_num_connections() > 0:
dist = self.read_dist_srf(0x19)
- self.send_range(self.pub_range_fwd_right, "sonar_forward_right", Range.ULTRASOUND, dist, 0.04, self.range_sensor_max, 30)
+ self.send_range(self.pub_range_fwd_right, "sonar_forward_right", Range.ULTRASOUND, dist, 0.04, self.range_sensor_max, self.range_sensor_fov)
def update_dist_forward_right(self):
if self.pub_range_fwd_right.get_num_connections() > 0: