ArduPilot / SITL_Models

Models of aircraft for SITL
82 stars 116 forks source link

Error arduplane no process found #111

Closed JohnVorwald closed 9 months ago

JohnVorwald commented 9 months ago

OS Ubuntu 20.04

dir structure ~/ardupilot ~/simulation/SITL_Models

Commands $ cd ~/simulation $ export ARDUPILOT_HOME=/home/john/ardupilot $ source SITL_Models/Gazebo/launch/truck-quadplane-landing.sh ~/simulation/SITL_Models/Gazebo/worlds ~/simulation ~/simulation Setting SIM_SPEEDUP=1.000000 Starting SITL: JSON Home: -35.363262 149.165237 alt=584.000000m hdg=0.000000 JSON control interface set to 127.0.0.1:9002 Starting sketch 'Rover' Starting SITL input Using Irlock at port : 9005 bind port 5760 for 0 Serial port 0 on TCP port 5760 Waiting for connection .... Setting SIM_SPEEDUP=1.000000 Starting SITL: JSON Home: -35.363262 149.165237 alt=584.000000m hdg=0.000000 JSON control interface set to 127.0.0.1:9012 Starting sketch 'Rover' Starting SITL input Using Irlock at port : 9015 bind port 5770 for 0 Serial port 0 on TCP port 5770 Waiting for connection .... Setting SIM_SPEEDUP=1.000000 Starting SITL: JSON Home: -35.363262 149.165237 alt=584.000000m hdg=0.000000 JSON control interface set to 127.0.0.1:9022 Starting sketch 'ArduPlane' Starting SITL input Using Irlock at port : 9025 bind port 5780 for 0 Serial port 0 on TCP port 5780 Waiting for connection .... {PRESS CTRL-C} ^CSITL_Models/Gazebo/launch/truck-quadplane-landing.sh: line 97: 504609 Killed $PLANE -S --model JSON --home=$HOMELAT,$HOMELONG,$HOMEALT,0 --speedup 1 --instance 2 --defaults $QUADPLANE_DEFAULTS,follower.param [4]+ Done wait SITL_Models/Gazebo/launch/truck-quadplane-landing.sh: line 60: 504601 Killed $ROVER -S --model JSON --home=$HOMELAT,$HOMELONG,$HOMEALT,0 --speedup 1 --instance 0 --defaults $TRACTOR_DEFAULTS,leader.param SITL_Models/Gazebo/launch/truck-quadplane-landing.sh: line 74: 504606 Killed $ROVER -S --model JSON --home=$HOMELAT,$HOMELONG,$HOMEALT,0 --speedup 1 --instance 1 --defaults $TRAILER_DEFAULTS,leader.param [3]+ Exit 137 ( cd sitl/quadplane && $PLANE -S --model JSON --home=$HOMELAT,$HOMELONG,$HOMEALT,0 --speedup 1 --instance 2 --defaults $QUADPLANE_DEFAULTS,follower.param ) john@cd0254nb032364:~/simulation$ ^Carduplane: no process found ardurover: no process found

[1] Exit 137 ( cd sitl/tractor && $ROVER -S --model JSON --home=$HOMELAT,$HOMELONG,$HOMEALT,0 --speedup 1 --instance 0 --defaults $TRACTOR_DEFAULTS,leader.param ) [2] Exit 137 ( cd sitl/trailer && $ROVER -S --model JSON --home=$HOMELAT,$HOMELONG,$HOMEALT,0 --speedup 1 --instance 1 --defaults $TRAILER_DEFAULTS,leader.param ) [3]+ Exit 1 source SITL_Models/Gazebo/launch/truck-quadplane-landing.sh

JohnVorwald commented 9 months ago

Gazebo version 11.14.0

srmainwaring commented 9 months ago

Gazebo version 11.14.0

Wrong version of Gazebo. Need Gazebo Garden or Harmonic: https://ardupilot.org/dev/docs/sitl-with-gazebo.html

JohnVorwald commented 9 months ago

If I don't press ctrl-c and run the gazebo command the model runway can't be found.

~/ardupilot/sitl$ gazebo worlds/truck_quadplane_landing.sdf

Error Code 12 Msg: Unable to find uri[model://runway] gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = gazebo::physics::Shape; typename boost::detail::sp_member_access::type = gazebo::physics::Shape*]: Assertion `px != 0' failed.

So, how can I include the runway model? And, is there a second error related to "Shape"?

JohnVorwald commented 9 months ago

Oh, I just saw your comment. I thought the problem may be the wrong gazebo version. I'll look into this more later. Can you tell me how to unistall gazebo-11, ubuntu 20.04?

srmainwaring commented 9 months ago

Hi @JohnVorwald - looks like you're looking for user support rather than raising an issue with the models in this repo. The best place for that is https://discuss.ardupilot.org/. If you open a new discussion there and include Gazebo in the tag I'll pick it up there.

JohnVorwald commented 9 months ago

I agree 👍

JohnVorwald commented 9 months ago

@srmainwaring I uninstalled gazebo-11, and installed gazebo garden, but I still get the same error, missing gazebo model files. I don't think this is an ardupilot topic.

uninstall gazebo-11 first. sudo apt remove gazebo11 && sudo apt autoremove

With gazebo-11 removed, use the binary installation https://gazebosim.org/docs/garde/install_ubuntu First install some necessary tools: sudo apt-get update sudo apt-get install lsb-release wget gnupg

Then install Gazebo Garden: sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null sudo apt-get update sudo apt-get install gz-garden

All libraries should be ready to use and the gz sim app ready to be executed. gz sim

This works. Run truck/uav sim

export ARDUPILOT_HOME=/home/john/ardupilot cd ~/simulation source SITL_Models/Gazebo/launch/truck-quadplane-landing.

This appears to work, but the next command doesn't seem to work.

Start gazebo garden in new terminal $ cd ~/ardupilot/sitl ~/ardupilot/sitl$ sudo apt-get install gz-garden ~/ardupilot/sitl$ gz sim -v 4 -r worlds/truck_quadplane_landing.sdf [Msg] Gazebo Sim GUI v7.6.0 [Dbg] [Gui.cc:261] Waiting for subscribers to [/gazebo/starting_world]... [Dbg] [gz.cc:165] Subscribing to [/gazebo/starting_world]. [Dbg] [gz.cc:167] Waiting for a world to be set from the GUI... [Msg] Received world [worlds/truck_quadplane_landing.sdf] from the GUI. [Dbg] [gz.cc:171] Unsubscribing from [/gazebo/starting_world]. [Msg] Gazebo Sim Server v7.6.0 [Msg] Loading SDF world file[/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf]. [Dbg] [Application.cc:96] Initializing application. [Dbg] [Application.cc:128] Qt using OpenGL graphics interface [GUI] [Dbg] [Application.cc:607] Create main window Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="tractor"]/model[@name="trailer"]/joint[@name="imu_joint"]/axis/use_parent_model_frame:/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf:L1274]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="tractor"]/joint[@name="imu_joint"]/axis/use_parent_model_frame:/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf:L1328]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_1_joint"]/axis/use_parent_model_frame:/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf:L1738]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_2_joint"]/axis/use_parent_model_frame:/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf:L1797]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_3_joint"]/axis/use_parent_model_frame:/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf:L1856]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_4_joint"]/axis/use_parent_model_frame:/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf:L1915]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_f_joint"]/axis/use_parent_model_frame:/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf:L1973]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="imu_joint"]/axis/use_parent_model_frame:/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf:L2187]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. [Err] [Server.cc:159] Error Code 14: [/sdf/world[@name="truck_quadplane_landing"]/include[0]/uri:/home/john/ardupilot/sitl/worlds/truck_quadplane_landing.sdf:L39]: Msg: Unable to find uri[model://runway] [Dbg] [gz.cc:417] Shutting down gz-sim-server [GUI] [Dbg] [PathManager.cc:67] Requesting resource paths through [/gazebo/resource_paths/get] [GUI] [Dbg] [SignalHandler.cc:142] Received signal[2]. [GUI] [Dbg] [SignalHandler.cc:142] Received signal[2]. [GUI] [Dbg] [Application.cc:173] Terminating application.

Still have the problem can't find model runway.

JohnVorwald commented 9 months ago

This is a "minor" issue, but line 31 of file "~/simulation/SITL_Models/Gazebo/launch/truck-quadplane-landing.sh" is

erb -T 1 truck_quadplane_landing.sdf.erb > $ROOTDIR/sitl/worlds/truck_quadplane_landing.sdf

this creates the file "~/ardupilot/sitl/worlds/truck_quadplane_landing.sdf", under folder $ROOTDIR = $ARDUPILOT_HOME while the other commands output to folders quadplane tractor trailer in ~/simulation/sitl, and there is an empty folder worlds under ~/simulation/sitl Let me try moving the file "~/ardupilot/sitl/worlds/truck_quadplane_landing.sdf" to folder "~/simulation/sitl/worlds" and see if the model runway can be found

~/simulation$ cd sitl/worlds/ ~/simulation/sitl/worlds$ cp ~/ardupilot/sitl/worlds/* . ~/simulation/sitl/worlds$ cd .. ~/simulation/sitl$ gz sim -v 4 -r worlds/truck_quadplane_landing.sdf [Msg] Gazebo Sim GUI v7.6.0 [Dbg] [Gui.cc:261] Waiting for subscribers to [/gazebo/starting_world]... [Dbg] [gz.cc:165] Subscribing to [/gazebo/starting_world]. [Dbg] [gz.cc:167] Waiting for a world to be set from the GUI... [Msg] Received world [worlds/truck_quadplane_landing.sdf] from the GUI. [Dbg] [gz.cc:171] Unsubscribing from [/gazebo/starting_world]. [Msg] Gazebo Sim Server v7.6.0 [Msg] Loading SDF world file[/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf]. [Dbg] [Application.cc:96] Initializing application. [Dbg] [Application.cc:128] Qt using OpenGL graphics interface [GUI] [Dbg] [Application.cc:607] Create main window Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="tractor"]/model[@name="trailer"]/joint[@name="imu_joint"]/axis/use_parent_model_frame:/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf:L1274]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="tractor"]/joint[@name="imu_joint"]/axis/use_parent_model_frame:/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf:L1328]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_1_joint"]/axis/use_parent_model_frame:/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf:L1738]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_2_joint"]/axis/use_parent_model_frame:/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf:L1797]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_3_joint"]/axis/use_parent_model_frame:/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf:L1856]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_4_joint"]/axis/use_parent_model_frame:/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf:L1915]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="motor_f_joint"]/axis/use_parent_model_frame:/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf:L1973]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. Warning [Utils.cc:130] [/sdf/world[@name="truck_quadplane_landing"]/model[@name="quadplane"]/joint[@name="imu_joint"]/axis/use_parent_model_frame:/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf:L2187]: XML Element[use_parent_model_frame], child of element[axis], not defined in SDF. Copying[use_parent_model_frame] as children of [axis]. [Err] [Server.cc:159] Error Code 14: [/sdf/world[@name="truck_quadplane_landing"]/include[0]/uri:/home/john/simulation/sitl/worlds/truck_quadplane_landing.sdf:L39]: Msg: Unable to find uri[model://runway] [Dbg] [gz.cc:417] Shutting down gz-sim-server [GUI] [Dbg] [SignalHandler.cc:142] Received signal[2]. [GUI] [Dbg] [SignalHandler.cc:142] Received signal[2]. [GUI] [Dbg] [PathManager.cc:67] Requesting resource paths through [/gazebo/resource_paths/get] [GUI] [Dbg] [Application.cc:173] Terminating application.

On github, in repository SITL_models, if I search for runway, I see theres a file named bicopter_runway.sdf that creates world runway. So, my gazebo search path should include that folder.

I if Iook at my env ~/simulation/sitl$ env | grep gazebo ROS_PACKAGE_PATH=/home/john/catkin_ws/src:/opt/ros/noetic/share:/home/john/Github/PX4-Autopilot:/home/john/Github/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic GAZEBO_PLUGIN_PATH=/home/john/catkin_ws/src/iq_sim/models:{GAZEBO_PLUGIN_PATH}:/home/john/Github/PX4-Autopilot/build/px4_sitl_default/build_gazebo-classic:/usr/lib/x86_64-linux-gnu/gazebo-11/plugins GAZEBO_RESOURCE_PATH=/home/john/catkin_ws/src/UAV_simulator_ArduCopter/ardupilot_gazebo/worlds: LD_LIBRARY_PATH=/home/john/catkin_ws/devel/lib:/opt/ros/noetic/lib:/home/john/Github/PX4-Autopilot/build/px4_sitl_default/build_gazebo-classic GAZEBO_MODEL_PATH=/home/john/catkin_ws/src/UAV_simulator_ArduCopter/ardupilot_gazebo/models_gazebo:/home/john/catkin_ws/src/UAV_simulator_ArduCopter/ardupilot_gazebo/models:{GAZEBO_MODEL_PATH}:/home/john/Github/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models

I have the file in this location ~/simulation/sitl$ ls ~/simulation/SITL_Models/Gazebo/worlds/bicopter_runway.sdf /home/john/simulation/SITL_Models/Gazebo/worlds/bicopter_runway.sdf

Then, I could try export GAZEBO_MODEL_PATH=/home/john/simulation/SITL_Models/Gazebo/worlds But, I still get the same error. Web search for "gazebo unable to find uri model //runway" takes me to this link

https://answers.gazebosim.org//question/27075/error-code-12-msg-unable-to-find-uri/

So, let's keep this closed, and I'll pursue resolution of the question in "https://answers.gazebosim.org". (But, it still looks like a gazebo sitl error to me, the error is in clarifying the setup)

srmainwaring commented 9 months ago

I think you are using an unsupported version of Gazebo (from your comment that you are setting GAZEBO_MODEL_PATH it looks like you are using Gazebo 11 - that is a very old version and will not work).

Edit.

Correction - the environment variable GAZEBO_MODEL_PATH is for Gazebo 11, but your command is for gz sim. The correct env variable for the plugin is GZ_SIM_SYSTEM_PLUGIN_PATH and the resources GZ_SIM_RESOURCE_PATH.

Please read the link on setting up the ArduPilot SITL / Gazebo environment I posted above and run the simple examples provided in the plugin repo (https://github.com/ArduPilot/ardupilot_gazebo). Move onto the multi-vehicle examples once that is working.

JohnVorwald commented 9 months ago

@srmainwaring runs fine now. I had removed the gazebo 11, and was using the gz sim version, just hadn't updated the env yet. Reinstalled ardupilot_gazebo was what was need. The iris sim works, so I believe I can figure out the rest from here. Thank you!