Tools: Expose map/console mavproxy args

* These can be set in ros2 launch calls now

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
This commit is contained in:
Ryan Friedman 2024-05-07 09:46:20 -06:00 committed by Randy Mackay
parent 4ffa74e23b
commit d520b77f77
2 changed files with 39 additions and 11 deletions

View File

@ -13,6 +13,14 @@ For example `ardurover` SITL may be launched with:
ros2 launch ardupilot_sitl sitl.launch.py command:=ardurover model:=rover
```
Other launch files are included with many arguments.
Some common arguments are exposed and forwarded to the underlying process.
For example, MAVProxy can be launched, and you can enable the `console` and `map`.
```bash
ros2 launch ardupilot_sitl sitl_mavproxy.launch.py map:=True console:=True
```
#### `ardupilot_dds_test`
A `colcon` package for testing communication between `micro_ros_agent` and the

View File

@ -286,26 +286,36 @@ class MAVProxyLaunch:
master = LaunchConfiguration("master").perform(context)
out = LaunchConfiguration("out").perform(context)
sitl = LaunchConfiguration("sitl").perform(context)
console = LaunchConfiguration("console").perform(context)
map = LaunchConfiguration("map").perform(context)
# Display launch arguments.
print(f"command: {command}")
print(f"master: {master}")
print(f"sitl: {sitl}")
print(f"out: {out}")
print(f"console: {console}")
print(f"map: {map}")
cmd = [
f"{command} ",
f"--out {out} ",
"--out ",
"127.0.0.1:14551 ",
f"--master {master} ",
f"--sitl {sitl} ",
"--non-interactive ",
]
if console:
cmd.append("--console ")
if map:
cmd.append("--map ")
# Create action.
mavproxy_process = ExecuteProcess(
cmd=[
[
f"{command} ",
f"--out {out} ",
"--out ",
"127.0.0.1:14551 ",
f"--master {master} ",
f"--sitl {sitl} ",
"--non-interactive ",
]
],
cmd=cmd,
shell=True,
output="both",
respawn=False,
@ -355,6 +365,16 @@ class MAVProxyLaunch:
default_value="127.0.0.1:5501",
description="SITL output port.",
),
DeclareLaunchArgument(
"map",
default_value="False",
description="Enable MAVProxy Map.",
),
DeclareLaunchArgument(
"console",
default_value="False",
description="Enable MAVProxy Console.",
),
]