Hello Bluerobotics team,
I am trying to build an AUV for a competition.
There will be a yellow colored frame submerged in water. 1.5m width, 1.0m height, rectangle
I have trained a yolo deep learning model to recognize it but as someone who has no dedicated gpu I am getting ~11Fps out of my code which drops to 7fps when sending pwm signals and receiving attitude data. I have different components running on different threads which helps with the speed problem a little.
there are several vehicle components like attitude reading, sending pwm signal, displaying attitude and camera feed. How does one do all but in a fast manner?
My computer runs QGC almost flawlessly and i bet gqc is doing much more that what my Ui is doing yet it is still slower. What are some principle that qgc uses to do all this? paralel processing? multithreading? multiprocessing? async operations?
Also I am facing several problem which I hope you can help me with.
1.
My t-200 thrusters aren’t running smoothly. By this I mean they carry out the given command stutteringly (but in the correct direction). The aren’t getting the pwm signals fast enough I think.
So my first question is: What should the maximum delay between manual controls commands?
Ps. I am using Manual_control_send instead of rc override.
2.
I have set my vehicle to depth hold mode using the example code on the pymavlink gitbook.
The vehicle mode is correctly being changed to depth hold mode, which I can check both from the behavior the vehicle and from QGr.Con.
the problem I am having is with Setting a target depth.
I do have a bar30 pressure sensor installed.
I am again using the example depth target setting function from gitbook but I receive and error.
It says that the function mav.set.position_target_global_int_send got and argument of unexpected type: long_int
as far as I know python3.x does not have long_ints but I may be incorrect.
What could I do about this unexpected type error.
i tried writing -1.0 as simply -1, i tried non integer values like -0,5, -0,7 as well and the same error came up.
I used the code on ardusub site exactly.
(I got this error with 2 linux laptops and an imac so it seems that the issue is not influenced by operating system.)
def set_target_depth(depth):
master.mav.set_position_target_global_int_send(
int(1e3 * (time.time() - boot_time)), # ms since boot
master.target_system, master.target_component,
coordinate_frame=mavutil.mavlink.MAV_FRAME_GLOBAL_INT,
type_mask=0xdfe, # ignore everything except z position
lat_int=0, long_int=0, alt=depth, # (x, y WGS84 frame pos - not used), z [m]
vx=0, vy=0, vz=0, # velocities in NED frame [m/s] (not used)
afx=0, afy=0, afz=0, yaw=0, yaw_rate=0
# accelerations in NED frame [N], yaw, yaw_rate
# (all not supported yet, ignored in GCS Mavlink)
)
set_target_depth(-1.0)
3.
Do the following functions need to be called in a while loop everytime or calling the functions once does the trick?
- changing flight mode
- setting target depth (if we dont want to change the value we already set)
- requesting message intervals
4.sending manual control signals in stabilize mode (x,y,z,yaw,buttons)
4.
what does type_mask indicate in the above code. I can convert 0xdfe from hexadecimal to binary yet I dont know what it represents. Is there a chart of the possible other typemasks?
5.
Can I send a target attitude request to the auv even if I dont have any thruster that can do the command.?
For example my rov design has 6 thrusters and can’t do controlled movement in the pitch axis.
I often find that when I send a command like going forwards, the auv also moves in the pitch axis (probably because the back of the vehicle is lighter/heavier. )
If i send it a target attitude command request of (roll = 0, pitch=0, meaning it to be paralel to ground) would the function give me an error? will the vehicle try some kind of 2 axis rotation to get movement in the third axis? (rotating along x and y = rotate around z kind of way)
Is there some way to get the vehicle to be always paralel to the ground?
6
Regarding the heartbeat message:
I believe that when using QGC the heartbeat messages are sent by qgc to the vehicle. My question is:
Do we need to code a similar thing when we are coding with python(pymavlink)?
Does our code need to send heartbeat messages to the auv aswell or does pymavlink handle that in the background?/ heartbeat messages dont need to be sent when using pymavlink?