Auterion / px4-jsbsim-bridge

JSBSim bridge for PX4 SITL/HITL simulations
BSD 3-Clause "New" or "Revised" License
25 stars 38 forks source link

Use getopts for parsing commandline arguments #17

Closed Jaeyoung-Lim closed 3 years ago

Jaeyoung-Lim commented 3 years ago

Problem Description This PR switches the command line argument to getopts, so that it can better handle required/optional variables. This also solves the problem that more than 5 arguments had to be passed to run the bridge. Now only the config file needs to be passed, with the scene with the -s flag

Before PR

jsbsim_bridge" "models/${JSBSIM_AIRCRAFT_DIR}" $JSBSIM_AIRCRAFT_MODEL ${model} "${src_path}/Tools/jsbsim_bridge/scene/${world}.xml" $HEADLESS

After PR

jsbsim_bridge" ${model} -s "${src_path}/Tools/jsbsim_bridge/scene/${world}.xml"

Next steps