GAZEBO SITL, Bi-copter

@rhys ello
I want to make Bicopter modeling into SITL.
However, I’m not familiar with SDF or XML formats,
and I search and solve what it means whenever an error occurs,
but I can’t find a solution.

Hi @Gel_kayano, interesting model for Gazebo - we don’t have one of these yet!

I can look through your project to see what’s going on, but any information you can supply will help, such as console outputs using verbose settings (i.e. run gz sim with the -v4 flag). Also, could you let me know if this is part of a assessed project, as in that case I can help with the trouble shooting but will have to let you make the changes to get the model working. If this is just a personal project I’d be happy to take a more in depth look and submit PRs to get the model working, in return it would be nice if it could be published to our repo of models in SITL_Models when it’s finished so others can use it with ArduPilot.

It would be nice to post it on repo in SITL_Models and make it an asset that everyone can share.

Thank you.

lck@aaa:~$ gz sim -v4 -r bicopter_runway.sdf
[Msg] Gazebo Sim GUI    v7.6.0
[Dbg] [gz.cc:165] Subscribing to [/gazebo/starting_world].
[Dbg] [gz.cc:167] Waiting for a world to be set from the GUI...
[Dbg] [Gui.cc:261] Waiting for subscribers to [/gazebo/starting_world]...
[Msg] Received world [bicopter_runway.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/lck/gz_ws/src/ardupilot_gazebo/worlds/bicopter_runway.sdf].
Warning [Utils.cc:130] [/sdf/world[@name="bicopter_runway"]/model[@name="axes"]/uri:/home/lck/gz_ws/src/ardupilot_gazebo/worlds/bicopter_runway.sdf:L108]: XML Element[uri], child of element[model], not defined in SDF. Copying[uri] as children of [model].
[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/model[@name="bicopter_with_standoffs"]/joint[@name="ser0"]/material:/home/lck/gz_ws/src/ardupilot_gazebo/models/bicopter_with_standoffs/model.sdf:L71]: XML Element[material], child of element[joint], not defined in SDF. Copying[material] as children of [joint].
Warning [Utils.cc:130] [/sdf/model[@name="bicopter_with_standoffs"]/link[@name="ccw-servo"]/box[@name="ccw-servo_collision"]:/home/lck/gz_ws/src/ardupilot_gazebo/models/bicopter_with_standoffs/model.sdf:L97]: XML Element[box], child of element[link], not defined in SDF. Copying[box] as children of [link].
Warning [Utils.cc:130] [/sdf/model[@name="bicopter_with_standoffs"]/link[@name="ccw-mot"]/box[@name="ccw-mot_collision"]:/home/lck/gz_ws/src/ardupilot_gazebo/models/bicopter_with_standoffs/model.sdf:L160]: XML Element[box], child of element[link], not defined in SDF. Copying[box] as children of [link].
Warning [Utils.cc:130] [/sdf/model[@name="bicopter_with_standoffs"]/link[@name="cw-servo"]/inertial/inertia/material:/home/lck/gz_ws/src/ardupilot_gazebo/models/bicopter_with_standoffs/model.sdf:L222]: XML Element[material], child of element[inertia], not defined in SDF. Copying[material] as children of [inertia].
Warning [Utils.cc:130] [/sdf/model[@name="bicopter_with_standoffs"]/link[@name="cw-servo"]/box[@name="cw-servo_collision"]:/home/lck/gz_ws/src/ardupilot_gazebo/models/bicopter_with_standoffs/model.sdf:L237]: XML Element[box], child of element[link], not defined in SDF. Copying[box] as children of [link].
Warning [Utils.cc:130] [/sdf/model[@name="bicopter_with_standoffs"]/link[@name="cw-mot"]/box[@name="cw-mot_collision"]:/home/lck/gz_ws/src/ardupilot_gazebo/models/bicopter_with_standoffs/model.sdf:L300]: XML Element[box], child of element[link], not defined in SDF. Copying[box] as children of [link].
Warning [Utils.cc:130] [/sdf/model[@name="bicopter_with_standoffs"]/gravity:/home/lck/gz_ws/src/ardupilot_gazebo/models/bicopter_with_standoffs/model.sdf:L328]: XML Element[gravity], child of element[model], not defined in SDF. Copying[gravity] as children of [model].
Warning [Utils.cc:130] [/sdf/model[@name="bicopter_with_standoffs"]/velocity_decay:/home/lck/gz_ws/src/ardupilot_gazebo/models/bicopter_with_standoffs/model.sdf:L329]: XML Element[velocity_decay], child of element[model], not defined in SDF. Copying[velocity_decay] as children of [model].
[Msg] Serving entity system service on [/entity/system/add]
[Dbg] [Physics.cc:880] Loaded [gz::physics::dartsim::Plugin] from library [/usr/lib/x86_64-linux-gnu/gz-physics-6/engine-plugins/libgz-physics-dartsim-plugin.so]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::Physics] for entity [1]
[Dbg] [Sensors.cc:506] Configuring Sensors system
[Dbg] [Sensors.cc:425] SensorsPrivate::Run
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::Sensors] for entity [1]
[Dbg] [Sensors.cc:402] SensorsPrivate::RenderThread started
[Dbg] [Sensors.cc:245] Waiting for init
[Msg] Create service on [/world/bicopter_runway/create]
[Msg] Remove service on [/world/bicopter_runway/remove]
[Msg] Pose service on [/world/bicopter_runway/set_pose]
[Msg] Pose service on [/world/bicopter_runway/set_pose_vector]
[Msg] Light configuration service on [/world/bicopter_runway/light_config]
[Msg] Physics service on [/world/bicopter_runway/set_physics]
[Msg] SphericalCoordinates service on [/world/bicopter_runway/set_spherical_coordinates]
[Msg] Enable collision service on [/world/bicopter_runway/enable_collision]
[Msg] Disable collision service on [/world/bicopter_runway/disable_collision]
[Msg] Material service on [/world/bicopter_runway/visual_config]
[Msg] Material service on [/world/bicopter_runway/wheel_slip]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::UserCommands] for entity [1]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::SceneBroadcaster] for entity [1]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::Imu] for entity [1]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::NavSat] for entity [1]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::JointStatePublisher] for entity [15]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::LiftDrag] for entity [15]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::LiftDrag] for entity [15]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::LiftDrag] for entity [15]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::LiftDrag] for entity [15]
[Msg] ApplyJointForce subscribing to Double messages on [/model/bicopter_with_ardupilot/joint/bicopter_with_standoffs::mot0/cmd_force]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::ApplyJointForce] for entity [15]
[Msg] ApplyJointForce subscribing to Double messages on [/model/bicopter_with_ardupilot/joint/bicopter_with_standoffs::mot1/cmd_force]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::ApplyJointForce] for entity [15]
[Msg] ApplyJointForce subscribing to Double messages on [/model/bicopter_with_ardupilot/joint/bicopter_with_standoffs::ser0/cmd_force]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::ApplyJointForce] for entity [15]
[Msg] ApplyJointForce subscribing to Double messages on [/model/bicopter_with_ardupilot/joint/bicopter_with_standoffs::ser1/cmd_force]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::ApplyJointForce] for entity [15]
[Dbg] [SystemManager.cc:74] Loaded system [ArduPilotPlugin] for entity [15]
[Msg] Loaded level [3]
[Msg] Serving world controls on [/world/bicopter_runway/control], [/world/bicopter_runway/control/state] and [/world/bicopter_runway/playback/control]
[Msg] Serving GUI information on [/world/bicopter_runway/gui/info]
[Msg] World [bicopter_runway] initialized with [1ms] physics profile.
[Msg] Serving world SDF generation service on [/world/bicopter_runway/generate_world_sdf]
[Msg] Serving world names on [/gazebo/worlds]
[Msg] Resource path add service on [/gazebo/resource_paths/add].
[Msg] Resource path get service on [/gazebo/resource_paths/get].
[Msg] Resource path resolve service on [/gazebo/resource_paths/resolve].
[Msg] Resource paths published on [/gazebo/resource_paths].
[Msg] Server control service on [/server_control].
[GUI] [Dbg] [PathManager.cc:67] Requesting resource paths through [/gazebo/resource_paths/get]
[GUI] [Dbg] [Gui.cc:341] GUI requesting list of world names. The server may be busy downloading resources. Please be patient.
[GUI] [Dbg] [PathManager.cc:56] Received resource paths.
[GUI] [Dbg] [Gui.cc:399] Requesting GUI from [/world/bicopter_runway/gui/info]...
[GUI] [Dbg] [GuiRunner.cc:149] Requesting initial state from [/world/bicopter_runway/state]...
[GUI] [Msg] Loading config [/home/lck/.gz/sim/7/gui.config]
[GUI] [Dbg] [Application.cc:459] Loading plugin [MinimalScene]
[GUI] [Dbg] [MinimalScene.cc:657] Creating gz-rendering interface for OpenGL
[GUI] [Dbg] [MinimalScene.cc:657] Creating gz-rendering interface for OpenGL
[GUI] [Dbg] [MinimalScene.cc:817] Creating render thread interface for OpenGL
[GUI] [Msg] Added plugin [3D View] to main window
[GUI] [Msg] Loaded plugin [MinimalScene] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [EntityContextMenuPlugin]
[GUI] [Wrn] [Application.cc:859] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML RenderWindowOverlay: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:859] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML EntityContextMenu: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Msg] Added plugin [Entity Context Menu] to main window
[GUI] [Msg] Loaded plugin [EntityContextMenuPlugin] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libEntityContextMenuPlugin.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [GzSceneManager]
[GUI] [Msg] Added plugin [Scene Manager] to main window
[GUI] [Msg] Loaded plugin [GzSceneManager] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libGzSceneManager.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [InteractiveViewControl]
[GUI] [Msg] Camera view controller topic advertised on [/gui/camera/view_control]
[GUI] [Msg] Camera reference visual topic advertised on [/gui/camera/view_control/reference_visual]
[GUI] [Msg] Camera view control sensitivity advertised on [/gui/camera/view_control/sensitivity]
[GUI] [Msg] Added plugin [Interactive view control] to main window
[GUI] [Msg] Loaded plugin [InteractiveViewControl] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libInteractiveViewControl.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [CameraTracking]
[GUI] [Msg] Added plugin [Camera tracking] to main window
[GUI] [Msg] Loaded plugin [CameraTracking] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libCameraTracking.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [MarkerManager]
[GUI] [Msg] Listening to stats on [/world/bicopter_runway/stats]
[GUI] [Msg] Added plugin [Marker Manager] to main window
[GUI] [Msg] Loaded plugin [MarkerManager] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMarkerManager.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [SelectEntities]
[GUI] [Msg] Added plugin [Select entities] to main window
[GUI] [Msg] Loaded plugin [SelectEntities] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libSelectEntities.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [Spawn]
[GUI] [Msg] Added plugin [Spawn] to main window
[GUI] [Msg] Loaded plugin [Spawn] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libSpawn.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [VisualizationCapabilities]
[GUI] [Msg] View as transparent service on [/gui/view/transparent]
[GUI] [Msg] View as wireframes service on [/gui/view/wireframes]
[GUI] [Msg] View center of mass service on [/gui/view/com]
[GUI] [Msg] View inertia service on [/gui/view/inertia]
[GUI] [Msg] View collisions service on [/gui/view/collisions]
[GUI] [Msg] View joints service on [/gui/view/joints]
[GUI] [Msg] View frames service on [/gui/view/frames]
[GUI] [Msg] Added plugin [Visualization capabilities] to main window
[GUI] [Msg] Loaded plugin [VisualizationCapabilities] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libVisualizationCapabilities.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [WorldControl]
[GUI] [Msg] Using world control service [/world/bicopter_runway/control]
[GUI] [Msg] Listening to stats on [/world/bicopter_runway/stats]
[GUI] [Dbg] [WorldControl.cc:250] Using an event to share WorldControl msgs with the server
[GUI] [Msg] Added plugin [World control] to main window
[GUI] [Msg] Loaded plugin [WorldControl] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libWorldControl.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [WorldStats]
[GUI] [Msg] Listening to stats on [/world/bicopter_runway/stats]
[GUI] [Msg] Added plugin [World stats] to main window
[GUI] [Msg] Loaded plugin [WorldStats] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libWorldStats.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [Shapes]
[GUI] [Msg] Added plugin [Shapes] to main window
[GUI] [Msg] Loaded plugin [Shapes] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libShapes.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [Lights]
[GUI] [Msg] Added plugin [Lights] to main window
[GUI] [Msg] Loaded plugin [Lights] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libLights.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [TransformControl]
[GUI] [Msg] Added plugin [Transform control] to main window
[GUI] [Msg] Loaded plugin [TransformControl] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libTransformControl.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [Screenshot]
[GUI] [Msg] Screenshot service on [/gui/screenshot]
[GUI] [Msg] Added plugin [Screenshot] to main window
[GUI] [Msg] Loaded plugin [Screenshot] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libScreenshot.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [CopyPaste]
[GUI] [Msg] Added plugin [Copy/Paste] to main window
[GUI] [Msg] Loaded plugin [CopyPaste] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libCopyPaste.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [ComponentInspector]
[GUI] [Msg] Added plugin [Component inspector] to main window
[GUI] [Msg] Loaded plugin [ComponentInspector] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libComponentInspector.so]
[GUI] [Dbg] [Application.cc:459] Loading plugin [EntityTree]
[GUI] [Wrn] [Application.cc:859] [QT] file::/EntityTree/EntityTree.qml:148:7: QML ToolButton: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Msg] Added plugin [Entity tree] to main window
[GUI] [Msg] Loaded plugin [EntityTree] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libEntityTree.so]
[GUI] [Dbg] [Application.cc:329] Loading window config
[GUI] [Msg] Using server control service [/server_control]
[GUI] [Dbg] [Application.cc:621] Applying config
[GUI] [Dbg] [MinimalScene.cc:657] Creating gz-rendering interface for OpenGL
[GUI] [Dbg] [MinimalScene.cc:817] Creating render thread interface for OpenGL
[Msg] Found no publishers on /stats, adding root stats topic
[Msg] Found no publishers on /clock, adding root clock topic
[Dbg] [SimulationRunner.cc:503] Creating PostUpdate worker threads: 7
[Dbg] [SimulationRunner.cc:514] Creating postupdate worker thread (0)
[Dbg] [SimulationRunner.cc:514] Creating postupdate worker thread (1)
[Dbg] [SimulationRunner.cc:514] Creating postupdate worker thread (2)
[Dbg] [SimulationRunner.cc:514] Creating postupdate worker thread (3)
[Dbg] [SimulationRunner.cc:514] Creating postupdate worker thread (4)
[Dbg] [SimulationRunner.cc:514] Creating postupdate worker thread (5)
[Msg] Found IMU sensor with name [bicopter_with_standoffs::imu_link::imu_sensor]
[Dbg] [ArduPilotPlugin.cc:1154] Computed IMU topic to be: world/bicopter_runway/model/bicopter_with_ardupilot/model/bicopter_with_standoffs/link/imu_link/sensor/imu_sensor/imu
[Dbg] [SDFFeatures.cc:328] Mesh construction from an SDF has not been implemented yet for dartsim. Use AttachMeshShapeFeature to use mesh shapes.
[Err] [SDFFeatures.cc:843] The geometry element of collision [base_link_collision] couldn't be created
Warning [GenericJoint.hpp:1480] [GenericJoint::setRestPosition] Value of _q0 [0], is out of the limit range [-1e+16, -1e+16] for index [0] of Joint [Joint].
Warning [GenericJoint.hpp:1480] [GenericJoint::setRestPosition] Value of _q0 [0], is out of the limit range [1e+16, 1e+16] for index [0] of Joint [Joint].
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[Dbg] [ImuSensor.cc:149] IMU data for [bicopter_with_ardupilot::bicopter_with_standoffs::imu_link::imu_sensor] advertised on [world/bicopter_runway/model/bicopter_with_ardupilot/model/bicopter_with_standoffs/link/imu_link/sensor/imu_sensor/imu]
[Msg] Serving scene information on [/world/bicopter_runway/scene/info]
[Msg] Serving graph information on [/world/bicopter_runway/scene/graph]
[Msg] Serving full state on [/world/bicopter_runway/state]
[Msg] Serving full state (async) on [/world/bicopter_runway/state_async]
[Msg] Publishing scene information on [/world/bicopter_runway/scene/info]
[Msg] Publishing entity deletions on [/world/bicopter_runway/scene/deletion]
[Msg] Publishing state changes on [/world/bicopter_runway/state]
[Msg] Publishing pose messages on [/world/bicopter_runway/pose/info]
[Msg] Publishing dynamic pose messages on [/world/bicopter_runway/dynamic_pose/info]
[Wrn] [Model.hh:69] Skipping serialization / deserialization for models with //pose/@relative_to attribute.
[Wrn] [Component.hh:144] Trying to serialize component with data type [N3sdf3v135WorldE], which doesn't have `operator<<`. Component will not be serialized.
[Dbg] [EntityComponentManager.cc:1655] Updated state thread iterators: 4 threads processing around 9 entities each.
[GUI] [Dbg] [MinimalScene.cc:606] Create scene [scene]
[GUI] [Dbg] [MinimalScene.cc:849] Creating texture node render interface for OpenGL
[GUI] [Wrn] [Component.hh:189] Trying to deserialize component with data type [N3sdf3v135WorldE], which doesn't have `operator>>`. Component will not be deserialized.
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Dbg] [TransformControl.cc:453] TransformControl plugin is using camera [scene::Camera(65527)]
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Dbg] [Spawn.cc:308] Spawn plugin is using camera [scene::Camera(65527)]
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Dbg] [SelectEntities.cc:452] SelectEntities plugin is using camera [scene::Camera(65527)]
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Dbg] [MarkerManager.cc:171] Advertise /marker/list service.
[GUI] [Dbg] [MarkerManager.cc:181] Advertise /marker/list.
[GUI] [Dbg] [MarkerManager.cc:191] Advertise /marker_array.
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Dbg] [CameraTracking.cc:171] CameraTrackingPrivate plugin is moving camera [scene::Camera(65527)]
[GUI] [Msg] Move to service on [/gui/move_to]
[GUI] [Msg] Follow service on [/gui/follow]
[GUI] [Msg] Move to pose service on [/gui/move_to/pose]
[GUI] [Msg] Camera pose topic advertised on [/gui/camera/pose]
[GUI] [Msg] Follow offset service on [/gui/follow/offset]
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Dbg] [InteractiveViewControl.cc:178] InteractiveViewControl plugin is moving camera [scene::Camera(65527)]
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Dbg] [EntityContextMenuPlugin.cc:79] Entity context menu plugin is using camera [scene::Camera(65527)]
Warning [Utils.cc:130] [/sdf/model[@name="axes"]/uri:<data-string>:L55]: XML Element[uri], child of element[model], not defined in SDF. Copying[uri] as children of [model].
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] It would be nice to post it on repo in SITL_Models and make it an asset that everyone can share. Thank you.
[Model.hh:98] Unable to deserialize sdf::Model

Hi @Gel_kayano, I’ve forked a copy of your repo. There are many problems with the model sdf files, they do not conform to the SDF specification so will not load into gz sim.

Were these generated from URDF, or did you create them by hand?

You don’t need separate copies of the Python scripts from ArduPilot, the ones in the ArduPilot distribution will work fine with a custom model, and standalone versions are unlikely to work correctly as they will not have the correct dependencies and runtime context.

Edit`

The model after fixing issues with the SDF. The joints are correctly placed, but the inertials seem offset. Would need dimensions or a datasheet to correct these, although a reasonable estimate would be to place them near the centre of the corresponding meshes.

Figure: bi-copter model joints

Figure: bi-copter inertials - CoM seems low, and servo CoMs are at origin?

1 Like

That’s amazing.

I lost a week because I couldn’t do this.

Once I answer your question,

I created it with URDF,
I converted this to sdf.
(gz sdf -p /my_urdf.urdf > /my_sdf.sdf)

Since then, the code inside has been modified continuously.

If you also need a URDF file,
I’ll upload it to GitHub.

Can I get that file (sdf)?

PR here: Restructure models and world files and fix bi-copter model by srmainwaring · Pull Request #1 · GreenPine-CK/bicopter_simulation · GitHub

I don’t need the URDF file - it’s cleaner as straight SDF. If you need to use with ROS then I’d recommend using the sdformat_urdf plugin to load the model to robot_state_publisher. It works well and simplifies the workflow. We have examples in ArduPilot of how to do this.

The model has no plugins attached for control. This should be straight forward to set up now, but you’ll need specs for prop dimensions and RPM or thrust details if you use the thrust plugin directly instead of lift drag (may need to do that if generating lift off the props with the lift drag plugin is too noisy).

Update

@Gel_kayano - couple more PRs here that should get you running with ArduPilot. You will need to tune the model etc. but the basic control and servo assignment is working.

Use rebase merge for the PRs in the order provided.

1 Like

@Gel_kayano thanks for merging the changes. There should be enough there now to run an ArduPilot SITL / Gazebo session for the bicopter. I have started initial investigations but have not succeeded in getting anything resembling a stable tune yet.

In STABILIZE the rc setpoint for takeoff is around 1740 (i.e. rc 3 1740). The instability sets in very quickly and the vehicle loses pitch and then roll control. Increasing or decreasing the attitide PIDs by half does not seem to improve things, so a bit stuck at the moment. Am wondering whether simulating the thrust by spinning the rotors is just too noisy for this vehicle. There are alternative approaches but they need a bit of work in the ArduPilot plugin to support. May look at this as there are other vehicles with similar simulation stability issues that may benefit (OmniCopter).

Update

A final PR sorts out the tuning: Complete initial tune to enable auto and guided modes by srmainwaring · Pull Request #5 · GreenPine-CK/bicopter_simulation · GitHub. The key changes to get it flying well:

  • Move base link CoM slightly forward to restore balance.
  • Increase damping in servo joints.
  • Increase P and D gains on servo position controller.
  • Increase max prop speed from 600 to 800 RPM.
  • Decrease P gain on motor velocity controller.
  • Reduce ATC_RAT_PIT_P and ATC_RAT_PIT_I by 50% and zero ATC_RAT_PIT_D to remove pitch oscillations.
  • Increase ATC_RAT_RLL_P and ATC_RAT_RLL_I and reduce ATC_RAT_RLL_D to improve roll response.
  • Reduce ATC_RAT_YAW_P and ATC_RAT_YAW_I by over 50% to remove yaw oscillations (also coupled to pitch control).

Figure: bicopter in auto mode

gz_bicopter_ardupilot_auto_trim

1 Like

hello.
Should I edit the parameters directly in

 /home/lck/ros_ws/src/bicopter_simulation/config/bicopter.param

Or is there another way?

No need. The last PR included all the updates, so if you pull the latest version of main you should have everything.

1 Like

ok,
I tried git core again.
Now it flies stably.

Thank you very much.

1 Like