Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SITL --add-param-file fails with multiple vehicles #28827

Open
eschutz opened this issue Dec 9, 2024 · 0 comments
Open

SITL --add-param-file fails with multiple vehicles #28827

eschutz opened this issue Dec 9, 2024 · 0 comments

Comments

@eschutz
Copy link

eschutz commented Dec 9, 2024

Bug report

Issue details

Passing a param file to sim_vehicle.py with --count > 1 causes ArduPlane SITL to fail to start.

Reproduce by running the following in the same directory as a valid parameter file my_plane.parm:
sim_vehicle.py -v plane --add-param-file=my_plane.parm --count 2

Running ArduPlane on its own (executed verbatim from the sim_vehicle.py logs, see below), and connecting with MAVProxy from another terminal, I get:
<ardupilot directory>/build/sitl/bin/arduplane -S --model plane --speedup 1 --slave 0 --defaults ../../../ardupilot/Tools/autotest/models/plane.parm,my_plane.parm --sim-address=127.0.0.1 -I0

Setting SIM_SPEEDUP=1.000000
Starting sketch 'ArduPlane'
Starting SITL input
Using Irlock at port : 9005
bind port 5760 for SERIAL0
SERIAL0 on TCP port 5760
Waiting for connection ....
Connection on serial port 5760
PANIC: Failed to load defaults from ../../../ardupilot/Tools/autotest/models/plane.parm,my_plane.parm

Running: sh dumpstack.sh 2879426 >dumpstack.sh_arduplane.2879426.out 2>&1
Failed
Running: sh dumpcore.sh 2879426 >dumpcore.sh_arduplane.2879426.out 2>&1
Failed

The PANIC line seems to indicate there's a problem with the parameter file path. When running the same command with one level of .. removed: <ardupilot directory>/build/sitl/bin/arduplane -S --model plane --speedup 1 --slave 0 --defaults ../../ardupilot/Tools/autotest/models/plane.parm,my_plane.parm --sim-address=127.0.0.1 -I0, ArduPlane runs as expected.
This suggests the problem lies at this line of code

path = os.path.join("..", path)

Note that this is in the same region that seems to cause another bug with multiple agents #28826.

Version
4df758f

Logs
Output of sim_vehicle.py:

SIM_VEHICLE: Using defaults from (../../../ardupilot/Tools/autotest/models/plane.parm)
SIM_VEHICLE: Adding parameters from (my_plane.parm)
SIM_VEHICLE: Run ArduPlane
SIM_VEHICLE: "<ardupilot directory>/Tools/autotest/run_in_terminal_window.sh" "ArduPlane" "<ardupilot directory>/build/sitl/bin/arduplane" "-S" "--model" "plane" "--speedup" "1" "--slave" "0" "--defaults" "../../../ardupilot/Tools/autotest/models/plane.parm,my_plane.parm" "--sim-address=127.0.0.1" "-I0"
SIM_VEHICLE: Run ArduPlane
SIM_VEHICLE: "<ardupilot directory>/Tools/autotest/run_in_terminal_window.sh" "ArduPlane" "<ardupilot directory>/build/sitl/bin/arduplane" "-S" "--model" "plane" "--speedup" "1" "--slave" "0" "--defaults" "../../../ardupilot/Tools/autotest/models/plane.parm,my_plane.parm" "--sim-address=127.0.0.1" "-I1"
RiTW: Starting ArduPlane : <ardupilot directory>/build/sitl/bin/arduplane -S --model plane --speedup 1 --slave 0 --defaults ../../../ardupilot/Tools/autotest/models/plane.parm,my_plane.parm --sim-address=127.0.0.1 -I0
RiTW: Starting ArduPlane : <ardupilot directory>/build/sitl/bin/arduplane -S --model plane --speedup 1 --slave 0 --defaults ../../../ardupilot/Tools/autotest/models/plane.parm,my_plane.parm --sim-address=127.0.0.1 -I1
SIM_VEHICLE: Run MavProxy
SIM_VEHICLE: "mavproxy.py" "--out" "127.0.0.1:14550" "--master" "tcp:127.0.0.1:5760" "--sitl" "127.0.0.1:5501" "--out" "127.0.0.1:14560" "--master" "tcp:127.0.0.1:5770" "--sitl" "127.0.0.1:5511"
Connect tcp:127.0.0.1:5760 source_system=255
[Errno 111] Connection refused sleeping
Connect tcp:127.0.0.1:5770 source_system=255

<mavinit logs>

Log Directory: 
Telemetry log: mav.tlog
Waiting for heartbeat from tcp:127.0.0.1:5760
MAV> link 1 down
link 2 down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant