Gel_kayano
(Greenpine-ck)
February 12, 2024, 12:37pm
1
Hello.
I would like to add a battery plug-in to the iris model provided by Ardupilot gazebo, and implement the measurement of flight time according to the battery capacity in sitl.
I’ve tried several times, including how to use the battery plug-in as an example,
Flight time is not implemented in sitl.
Please give me an idea of what to do.
Thank you.
<?xml version="1.0" ?>
<!--
Linear battery demo
This demo has 2 vehicles: a green one with a rechargeable battery, and blue one with a normal battery.
It's recommended to run this demo at a high RTF, so it's faster to observe the battery drain:
gz sim -v 4 linear_battery_demo.sdf -z 1000000
Move both vehicles:
gz topic -t "/model/vehicle_blue/cmd_vel" -m gz.msgs.Twist -p "linear: {x: 6.0} angular: {z: 0.4}"
gz topic -t "/model/vehicle_green/cmd_vel" -m gz.msgs.Twist -p "linear: {x: 6.0} angular: {z: 0.4}"
Listen to battery state of charge:
gz topic -e -t /model/vehicle_blue/battery/linear_battery/state
Recharge the battery using a service (default):
gz service -s /model/vehicle_blue/battery/linear_battery/recharge/start --reqtype gz.msgs.Boolean --reptype gz.msgs.Empty --req 'data:true' --timeout 1000
This file has been truncated. show original
@rhys