Skip to content

Commit

Permalink
Merge branch 'main' into feat/continental_drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
knzo25 authored Mar 26, 2024
2 parents f0c57f4 + 18bb03a commit 6a7ff4c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions nebula_ros/launch/nebula_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ def launch_setup(context, *args, **kwargs):
sensor_params_fp = os.path.join(nebula_ros_share_dir, "config", "BaseParams.yaml")
assert os.path.exists(sensor_params_fp), "Sensor params yaml file under config/ was not found: {}".format(sensor_params_fp)

sensor_calib_fp = sensor_corr_fp = ""
if sensor_extension is not None: # Velodyne and Hesai
sensor_calib_fp = os.path.join(nebula_decoders_share_dir, "calibration", sensor_make.lower(), sensor_model + sensor_extension)
assert os.path.exists(sensor_calib_fp), "Sensor calib file under calibration/ was not found: {}".format(sensor_calib_fp)
else: # Robosense
sensor_calib_fp = ""

if sensor_model.lower() == "pandarat128":
sensor_corr_fp = os.path.splitext(sensor_calib_fp)[0] + ".dat"
assert os.path.exists(sensor_corr_fp), "Sensor corr file under calibration/ was not found: {}".format(sensor_corr_fp)

with open(sensor_params_fp, "r") as f:
sensor_params = yaml.safe_load(f)["/**"]["ros__parameters"]
Expand All @@ -81,7 +84,7 @@ def launch_setup(context, *args, **kwargs):
"sensor_ip": LaunchConfiguration("sensor_ip"),
"return_mode": LaunchConfiguration("return_mode"),
"calibration_file": calibration_file or sensor_calib_fp,
"correction_file": correction_file or sensor_calib_fp,
"correction_file": correction_file or sensor_corr_fp,
"setup_sensor": LaunchConfiguration("setup_sensor"),
"ptp_profile": LaunchConfiguration("ptp_profile"),
"ptp_domain": LaunchConfiguration("ptp_domain"),
Expand All @@ -107,7 +110,7 @@ def launch_setup(context, *args, **kwargs):
"sensor_ip": LaunchConfiguration("sensor_ip"),
"return_mode": LaunchConfiguration("return_mode"),
"calibration_file": calibration_file or sensor_calib_fp,
"correction_file": correction_file or sensor_calib_fp,
"correction_file": correction_file or sensor_corr_fp,
},
],
)
Expand All @@ -124,7 +127,7 @@ def launch_setup(context, *args, **kwargs):
"sensor_ip": LaunchConfiguration("sensor_ip"),
"return_mode": LaunchConfiguration("return_mode"),
"calibration_file": calibration_file or sensor_calib_fp,
"correction_file": correction_file or sensor_calib_fp,
"correction_file": correction_file or sensor_corr_fp,
"launch_hw": LaunchConfiguration("launch_hw"),
"ptp_profile": LaunchConfiguration("ptp_profile"),
"ptp_domain": LaunchConfiguration("ptp_domain"),
Expand Down

0 comments on commit 6a7ff4c

Please sign in to comment.