Coder Social home page Coder Social logo

Comments (5)

SwiftGust avatar SwiftGust commented on August 23, 2024

Currently my repository doesn't have surface or underwater vehicles, and I don't know about the surface vehicle dynamics.

If you wanna build boat SITL model for ArduPilot, you can use gazebo hydrodynamics plugin.
This is supported by gazebo simulator natively, you can refer tutorial at http://gazebosim.org/tutorials?tut=hydrodynamics&cat=physics and models in my repository.

And there is gazebo boat model for PX4 at https://github.com/PX4/sitl_gazebo for quick look, it doesn't use hydrodynamics plugin, it is simulating boat dynamics with own built plugin as in https://github.com/PX4/sitl_gazebo/blob/master/src/gazebo_usv_dynamics_plugin.cpp

you can also use this plugin to simulate vehicle dynamics and use interface in this repository to create SITL model for ArduPilot

from ardupilot_gazebo.

imgod26 avatar imgod26 commented on August 23, 2024

Is there a way to use the worlds and models from this. https://bitbucket.org/osrf/vrx/src/default/

And run it with SwiftGust and Ardurover sailboat SITL.

from ardupilot_gazebo.

SwiftGust avatar SwiftGust commented on August 23, 2024

It seems no problem at all using gazebo models & worlds in the VRX.

The only missing thing from VRX is USV model built with USV plugin in their own repository,
you can refer PX4 boat model, now I see it is same USV plugin from VRX, so this model dynamics should be compatible with VRX model - https://github.com/PX4/sitl_gazebo/blob/master/models/boat/boat.sdf

Other thing you require is to replace PX4 - Gazebo plugin setup with ArduPilot - Gazebo plugin in this repository.
PX4 Gazebo plugin settings seems quite large but nothing much since PX4 prefers modular architecture so you wouldn't have much problem.
https://github.com/PX4/sitl_gazebo/blob/0823f5e006011d36858c2dd39881874c1edac10b/models/boat/boat.sdf#L448-L577 except just leave usv dyanmics part at https://github.com/PX4/sitl_gazebo/blob/0823f5e006011d36858c2dd39881874c1edac10b/models/boat/boat.sdf#L515-L536

Regarding setting up ArduPilot - Gazebo Plugin, refer models in my repository
example -

<plugin name="ardupilot_plugin" filename="libArduPilotPlugin.so">
<fdm_addr>127.0.0.1</fdm_addr>
<fdm_port_in>9002</fdm_port_in>
<fdm_port_out>9003</fdm_port_out>
<modelXYZToAirplaneXForwardZDown>0 0 0 3.141593 0 -1.57079</modelXYZToAirplaneXForwardZDown>
<gazeboXYZToNED>0 0 0 3.141593 0 -1.57079</gazeboXYZToNED>
<imuName>zephyr_delta_wing_demo::zephyr_delta_wing::zephyr/imu_link::imu_sensor</imuName>
<connectionTimeoutMaxCount>5</connectionTimeoutMaxCount>
<control channel="2">
<!--
incoming control command [0, 1]
so offset it by 0 to get [0, 1]
and divide max target by 1.
offset = 0
multiplier = 838 max rpm / 1 = 838
-->
<multiplier>838</multiplier>
<offset>0.2</offset>
<type>VELOCITY</type>
<p_gain>0.5</p_gain>
<i_gain>0</i_gain>
<d_gain>0</d_gain>
<i_max>0</i_max>
<i_min>0</i_min>
<cmd_max>2.0</cmd_max>
<cmd_min>0.0</cmd_min>
<jointName>zephyr_delta_wing::propeller_joint</jointName>
</control>
<control channel="1">
<multiplier>-1</multiplier>
<offset>-0.5</offset>
<type>POSITION</type>
<p_gain>10.0</p_gain>
<i_gain>0</i_gain>
<d_gain>0</d_gain>
<i_max>0</i_max>
<i_min>0</i_min>
<cmd_max>2.0</cmd_max>
<cmd_min>-2.0</cmd_min>
<jointName>zephyr_delta_wing::flap_left_joint</jointName>
</control>
<control channel="0">
<multiplier>-1</multiplier>
<offset>-0.5</offset>
<type>POSITION</type>
<p_gain>10.0</p_gain>
<i_gain>0</i_gain>
<d_gain>0</d_gain>
<i_max>0</i_max>
<i_min>0</i_min>
<cmd_max>2.0</cmd_max>
<cmd_min>-2.0</cmd_min>
<jointName>zephyr_delta_wing::flap_right_joint</jointName>
</control>
</plugin>

Sensors -

<sensor name="gps_sensor" type="gps">
<pose>0 0 0 0 0 0</pose>
<update_rate>10.0</update_rate>
<always_on>true</always_on>
<gps>
<position_sensing>
<horizontal>
<noise type="gaussian_quantized">
<mean>0</mean>
<stddev>1</stddev>
<bias_mean>3</bias_mean>
<bias_stddev>1</bias_stddev>
<precision>0.5</precision>
</noise>
</horizontal>
<vertical>
<noise type="gaussian_quantized">
<mean>0</mean>
<stddev>1</stddev>
<bias_mean>3</bias_mean>
<bias_stddev>1</bias_stddev>
<precision>1.0</precision>
</noise>
</vertical>
</position_sensing>
<velocity_sensing>
<horizontal>
<noise type="gaussian_quantized">
<mean>0</mean>
<stddev>0.1</stddev>
<bias_mean>0.1</bias_mean>
<bias_stddev>0.1</bias_stddev>
<precision>0.1</precision>
</noise>
</horizontal>
<vertical>
<noise type="gaussian_quantized">
<mean>0</mean>
<stddev>0.2</stddev>
<bias_mean>0.2</bias_mean>
<bias_stddev>0.2</bias_stddev>
<precision>0.2</precision>
</noise>
</vertical>
</velocity_sensing>
</gps>
</sensor>
<link name='zephyr/imu_link'>
<inertial>
<pose>0 0 0 0 0 0</pose>
<mass>0.15</mass>
<inertia>
<ixx>0.00001</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>0.00002</iyy>
<iyz>0</iyz>
<izz>0.00002</izz>
</inertia>
</inertial>
<sensor name="imu_sensor" type="imu">
<pose>0 0 0 3.141593 0 -1.57079</pose>
<always_on>1</always_on>
<update_rate>1000.0</update_rate>
</sensor>
</link>
<joint name='zephyr/imu_joint' type='revolute'>
<child>zephyr/imu_link</child>
<parent>wing</parent>
<axis>
<xyz>0 0 1</xyz>
<limit>
<lower>0</lower>
<upper>0</upper>
<effort>0</effort>
<velocity>0</velocity>
</limit>
<dynamics>
<damping>1.0</damping>
</dynamics>
<use_parent_model_frame>1</use_parent_model_frame>
</axis>
<physics>
<ode>
<implicit_spring_damper>1</implicit_spring_damper>
</ode>
</physics>
</joint>

from ardupilot_gazebo.

Ric-27 avatar Ric-27 commented on August 23, 2024

did you managed to use vrx models with ardupilot-gazebo plugin?
I was able to combine the ardupilot plugin with the vrx simulation (waves and wind) but when I click the ardupilot plugin inside gazebo i get the following error.
image

from ardupilot_gazebo.

ericjohnson97 avatar ericjohnson97 commented on August 23, 2024

I was able to setup a simulation using the ardupilot plugin and the bouyancy plugin from px4. here is my simulation repo. there is a section about setting it up for simulating boats https://github.com/Intelligent-Quads/iq_sim

from ardupilot_gazebo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.