Compare commits

...

2 Commits

Author SHA1 Message Date
chyoo 2a559eda07 feat: support Yahboom in shared Nav2 perception 2026-09-22 11:12:05 +09:00
chyoo 2c1c31817d fix(nav2): align mkmini lidar transform 2026-08-12 10:17:21 +09:00
4 changed files with 26 additions and 6 deletions
+2 -3
View File
@@ -1,8 +1,8 @@
lidar:
x: 0.1
x: 0.15
y: 0.0
z: 0.6
z: 0.5
roll: 0.0
pitch: 0.0
yaw: 0.0
@@ -28,4 +28,3 @@ rgb_front:
yaw: 1.035
frame_id: base_link
child_frame_id: hero/rgb_front
+2 -2
View File
@@ -1,8 +1,8 @@
lidar:
x: 0.1
x: 0.15
y: 0.0
z: 0.6
z: 0.5
roll: 0.0
pitch: 0.0
yaw: 0.0
@@ -6,11 +6,14 @@ def build_perception_commands(config):
level = config.get("level")
robot = config.get("robot", "")
sim_mode = str(config.get("sim_mode", False)).lower()
# Yahboom's vehicle/Agent already provide scan, odometry and sensor TF.
# Do not start a second odometry or point-cloud conversion pipeline.
yahboom_direct_scan = robot == "yahboom" and level == "2d"
# Gazebo's TurtleBot3 model publishes LaserScan directly. Launching the
# pointcloud conversion stack here is both redundant and unsupported.
if sim_mode == "true" and robot == "turtlebot3":
return cmds
if level and level != "None":
if level and level != "None" and not yahboom_direct_scan:
cmds.append(["ros2", "launch", f"perception{level}_pkg",
"perception.launch.py", f"robot:={robot}", f"sim_mode:={sim_mode}"])
for entry in config.get("perception") or []:
@@ -1,6 +1,24 @@
from perception_pkg.launch_spec import build_perception_commands
def test_yahboom_does_not_duplicate_scan_and_tf():
for simulation in (True, False):
assert build_perception_commands({
"level": "2d", "robot": "yahboom", "sim_mode": simulation}) == []
def test_yahboom_keeps_explicit_extra_processing():
commands = build_perception_commands({
"level": "2d", "robot": "yahboom", "sim_mode": True,
"perception": [{"package": "custom_detector"}]})
assert commands == [["ros2", "launch", "custom_detector", "perception.launch.py"]]
def test_turtlebot_simulation_remains_direct_scan():
assert build_perception_commands({
"level": "2d", "robot": "turtlebot3", "sim_mode": True}) == []
def test_level_only():
cmds = build_perception_commands({"level": "3d", "robot": "mkmini", "sim_mode": True})
assert ["ros2", "launch", "perception3d_pkg", "perception.launch.py", "robot:=mkmini", "sim_mode:=true"] in cmds