You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
639 B
20 lines
639 B
#!/bin/sh |
|
# shellcheck disable=SC2154 |
|
|
|
simulator_tcp_port=$((4560+px4_instance)) |
|
|
|
# Check if PX4_SIM_HOSTNAME environment variable is empty |
|
# If empty check if PX4_SIM_HOST_ADDR environment variable is empty |
|
# If both are empty use localhost for simulator |
|
if [ -z "${PX4_SIM_HOSTNAME}" ]; then |
|
if [ -z "${PX4_SIM_HOST_ADDR}" ]; then |
|
echo "PX4 SIM HOST: localhost" |
|
simulator start -c $simulator_tcp_port |
|
else |
|
echo "PX4 SIM HOST: $PX4_SIM_HOST_ADDR" |
|
simulator start -t $PX4_SIM_HOST_ADDR $simulator_tcp_port |
|
fi |
|
else |
|
echo "PX4 SIM HOST: $PX4_SIM_HOSTNAME" |
|
simulator start -h $PX4_SIM_HOSTNAME $simulator_tcp_port |
|
fi
|
|
|