Compare commits
4 Commits
75c9b7e104
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a559eda07 | |||
| 2c1c31817d | |||
| a1e0abb7fd | |||
| ee56703ea2 |
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
lidar:
|
lidar:
|
||||||
x: 0.1
|
x: 0.15
|
||||||
y: 0.0
|
y: 0.0
|
||||||
z: 0.6
|
z: 0.5
|
||||||
roll: 0.0
|
roll: 0.0
|
||||||
pitch: 0.0
|
pitch: 0.0
|
||||||
yaw: 0.0
|
yaw: 0.0
|
||||||
@@ -28,4 +28,3 @@ rgb_front:
|
|||||||
yaw: 1.035
|
yaw: 1.035
|
||||||
frame_id: base_link
|
frame_id: base_link
|
||||||
child_frame_id: hero/rgb_front
|
child_frame_id: hero/rgb_front
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
lidar:
|
lidar:
|
||||||
x: 0.1
|
x: 0.15
|
||||||
y: 0.0
|
y: 0.0
|
||||||
z: 0.6
|
z: 0.5
|
||||||
roll: 0.0
|
roll: 0.0
|
||||||
pitch: 0.0
|
pitch: 0.0
|
||||||
yaw: 0.0
|
yaw: 0.0
|
||||||
|
|||||||
@@ -6,7 +6,14 @@ def build_perception_commands(config):
|
|||||||
level = config.get("level")
|
level = config.get("level")
|
||||||
robot = config.get("robot", "")
|
robot = config.get("robot", "")
|
||||||
sim_mode = str(config.get("sim_mode", False)).lower()
|
sim_mode = str(config.get("sim_mode", False)).lower()
|
||||||
if level and level != "None":
|
# 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" and not yahboom_direct_scan:
|
||||||
cmds.append(["ros2", "launch", f"perception{level}_pkg",
|
cmds.append(["ros2", "launch", f"perception{level}_pkg",
|
||||||
"perception.launch.py", f"robot:={robot}", f"sim_mode:={sim_mode}"])
|
"perception.launch.py", f"robot:={robot}", f"sim_mode:={sim_mode}"])
|
||||||
for entry in config.get("perception") or []:
|
for entry in config.get("perception") or []:
|
||||||
|
|||||||
@@ -1,6 +1,24 @@
|
|||||||
from perception_pkg.launch_spec import build_perception_commands
|
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():
|
def test_level_only():
|
||||||
cmds = build_perception_commands({"level": "3d", "robot": "mkmini", "sim_mode": True})
|
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
|
assert ["ros2", "launch", "perception3d_pkg", "perception.launch.py", "robot:=mkmini", "sim_mode:=true"] in cmds
|
||||||
|
|||||||
Reference in New Issue
Block a user