Rover enable slide behavior

I am trying to build a Fmuv3 Rover firmware with @rmackay9 commit from 1.11.2022 with AC_Avoid slide enabled. After many errors with submodules resolved, still stuck with the AP_UAVCAN_DNA_Server.cpp error.If there is a built 4.x firmware with slide enabled, please point at it or help with an error.

I think this might do what you want, its essentially using sonars to trigger mavlink RC override commands to avoid obsticles. you could use it to nudge the vehicle in auto mode, ideally updating it with some modern sensors like lidars would be the way to go.

Hello, thanks for the help. Still reading through.

It reminds me on my experiment to connect old APM with pixhawk in “series”,using ultrasonic sensors on APM to correct pixhawks output. I remember combining different type of sonars as they have slight different frequency and so they dont interfere without using a stop pin.

1 Like

Its basically the same idea, but your sending in rc corrections over telemetry. The program pings the sonars sequentially so you shouldn’t have to worry about interferance.

:+1:t2: worth trying.Basicaly i neen only two sonars for my purpose, so i guess i remove the rest from the code.

I think you will need to enable nudge in the parameters so you can adjust its course using rc commands while in AUTO mode.

Which one is that in your code ?

sorry its called STICK_MIXING, I was thinking of throttle nudge.

Ok, i got it, i enable stick mixing , and the code will do the " nudge" part.That sounds great. Didnt se that parameter before.Sounds just what i need.

1 Like

well i uploaded the code only to realize it is not ment for rover, it modifies roll and pitch not yaw.Otherwise it would be usefull for rovers which are not that subtle regarding safety, more simple and they dont chrash because of little error in code :slight_smile: any help with the code appreciated

1 Like

I think you need to change this line here, this sets where the channels get injected.

remember all its sending is RC overide commands it doesnt matter if its roll or yaw in the arduino program

to change the channel the corrections get sent to you need to change this line

mavlink_msg_rc_channels_override_pack(255, 0 , msg, 1, 0, RollOut, PitchOut, 0, 0, 0, 0, 0, 0);

this is the values for channels 1-8 we are sending, so this program will send its roll corrections on channel 1 and its pitch corrections to channel 2,

just change that line to

mavlink_msg_rc_channels_override_pack(255, 0 , msg, 1, 0, 0, 0, RollOut, 0, 0, 0, 0, 0);

and you will get only corrections on channel 4, where i assume your yaw channel is.

Thanks a lot. Will try that?

I just seen an issue that said stick mixing was broken in 4.2, but its fixed in latest 4.3dev.

1 Like

Thanks, you saved me some time. I am playing with script, i had to add some delay between pings to make it work i think the bouncing sound was interfering with each other, and so it would happen in my wineyard.Now i got proper response from three sensors, front, and both sides. I am just connecting it to pixhawk (and upgading to 4.3dev )

I just have one subquestion, as i prefer setting rover in skid mode (each motor separate channel) how should i modify the code to make it work that way ?

no idea, your better to let ardupilot deal with stick mixing, otherwise your basically going to end up in the situation where you have a mixer getting mixed into a mixer.

1 Like

yes, actually that is my original setup ch1 left ch3 right motor. Ardupilot does the mixing. But for arduino sensors code to work i will have to set ch1 steering and ch3 throttle. (with “rollout” placed propperly in code as you have shown). I will try it anyway and deal with steering sharp corners later.

the code is applying RC inputs not servo outputs, it doesnt matter how the motors work as long as it goes the right direction. you just need to apply the left and right correction to your yaw RC channel.

1 Like

Ok, got it.That means i can actually keep the skid setup which is great.For checking the code on the bench iguess i can expect servo output to be modified (via rc) in manual mode.
Thanks for all the help.

I got some correct feedback on pixhawk side.Yeah it does not matter how the channel is called as long is the right one :grinning:.I think i will reduce inertia compensation for may case. Cant wait to test it next week.

1 Like

You could add a rc controlled switch to disable the proximity system, so its only active when its in auto mode.

Either use a rc switch or gpio controlled transistor to cut power to the arduino or you could add a line to the arduino code so its only active if a pin is pulled low, then control that with ardupilots relay output, using a rc channl or lua script.

Thanks, that is easily solved as you say. At the moment i am struggling to get the propper output from arduino for my purpose. It is still too advanced for what i need. It has “3d logic” while i need 2D.When i try to reduce the number of sensors in the code and on board, it just does not work propperly.