I have just release APMrover2 2.40 for your rovering pleasure!
First off, I'd like to give a big thank you to Tom, Linus, Greg and Steve for their help with this release. It has been a long time coming, and their help was invaluable!
Secondly, you should all know that I fully expect to need to do another rover release fairly soon - possibly i the next week or two. There is a lot of new code in this release, and there are bound to be bugs. Tom and Linus have been doing a lot of testing over the last few days, and I'm sure when we have our next rover dev call they will tell me about all the bugs they have found, and we will get a new release out.
The reason I'm doing the release now is I just spent a couple of hours driving my rover around the local park, and it is working very well for me. The sonar works nicely, the auto missions work, RTL works, steering mode works and pretty much everything worked as expected. So I decided to do the release, and will then get feedback from the community for the next release. I think this new release is a great basis for our future development, and I wanted to get it out so we start getting more feedback from users.
As I described in the 2.40-beta release discussion, there are a lot of new features in this release! I think it is fair to say that there is more code that has changed than code that has stayed the same.
The key new features are:
- support for skid steering
- support for dual sonars
- completely new failsafe code
- support for auto-start using a trigger pin
- support for auto kick-starting
- speed scaling of turns to reduce the chance of a roll over
- scaling of throttle on waypoint approach and turn
- more control over obstacle avoidance
- new 'STEERING' mode for testing auto-tuning
- support for the PX4 board
You'll have to wait for the full documentation for a full explanation of the new features, but I thought I'd explain some of them now to get you started.
Skid Steering
You can now control a tank-track style vehicle (skid steering) by setting two parameters, SKID_STEER_IN and SKID_STEER_OUT. The SKID_STEER_IN parameter tells the APM that RC input channels 1 and 3 (which are normally steering and throttle) should be assumed to be motor speed control from a RC transmitter setup for skid steering, such as the sort of transmitter that may come with a RC tank. The APM will map those channel inputs onto steering and throttle.
The SKID_STEER_OUT parameter tells the APM that you have a skid steering vehicle, and that output channels 1 and 3 control the left and right motor respectively.
Notice that you can set these two options separately. This is to allow you to use a traditional RC controller with a tank if you want to.
The code doesn't yet know about turning on the spot with skid steering - that will have to come later.
Dual Sonars
If you look through the parameters in the "advanced parameter list" in MissionPlanner you will see lots of parameters starting with SONAR. Here is the current list:
- SONAR_DEBOUNCE
- SONAR_ENABLE
- SONAR_FUNCTION
- SONAR_MAX_CM
- SONAR_MIN_CM
- SONAR_OFFSET
- SONAR_PIN
- SONAR_SCALING
- SONAR_TRIGGER_CM
- SONAR_TURN_ANGLE
- SONAR_TURN_TIME
- SONAR2_ENABLE
- SONAR2_FUNCTION
- SONAR2_MAX_CM
- SONAR2_MIN_CM
- SONAR2_OFFSET
- SONAR2_PIN
- SONAR2_SCALING
That is quite a lot of parameters to play with! You can enable 0, 1 or 2 sonars. Each sonar can be of a different type, with a different mapping function between voltage and range. You can choose what analog pin each sonar is connected to. You can also choose the turn angle that the obstacle avoidance code will use when it detects an object, how long it will turn for, and how much debouncing it will do on the sonar signal.
To help you debug all these new sonar parameters, we have a new driving mode, called STEERING mode.
Steering Mode
Steering mode is a bit like learning mode, except that the controls use the same steering, throttle and obstacle avoidance code as AUTO mode does. The steering controls the "navigation bearing", which is what AUTO uses to navigate. The throttle controls the target speed, just like AUTO does. When it sees an obstacle it tries to avoid it in the same way that AUTO does. It even does turn speed scaling.
So you can use STEERING mode to test your rover while remaining fully in control. Drive it at a obstacle, and it will avoid it, which is not only fun, it's great for tuning.
New Failsafe Code
The new failsafe code gives you much more control over what happens when you go out of RC range, or you lost contact with the ground station. The key parameters are:
- FS_ACTION
- FS_GCS_ENABLE
- FS_THR_ENABLE
- FS_THR_VALUE
- FS_TIMEOUT
The FS_ACTION parameters tells APM what to do when a failsafe triggers. You have 3 choices - do nothing, start an RTL or hold position (there is a new driving mode called 'HOLD' to support that last option). The other options control what triggers a failsafe, and how long the failsafe condition has to happen for before it triggers.
New Auto Start options
Have you ever wanted to kick your rover? Now you have an excuse. There is a new AUTO_KICKSTART option which tells the APM not to start the motor in AUTO until it sees an X acceleration of a specific number of m/s/s. So put your rover on the start line, flick it to AUTO then give it a kick to start it going. Don't kick too hard :-)
There is also a AUTO_TRIGGER_PIN option that allows you to set an input pin that can be used for a more gentle AUTO start. Attach a switch which shorts that pin to ground and you have yourself a start button for AUTO.
Speed Scaling
To drive a course at high speed you need to slow down in turns, unless your rover is on rails. To support higher speeds the new rover code now supports options to control when to slow down.
- SPEED_TURN_DIST
- SPEED_TURN_GAIN
The distance is how soon before a waypoint the rover starts to slow. Watch out for GPS lag!
The turn gain is how much it drops the throttle when approaching a waypoint or turning. If you have a low center of gravity this can be close to 100%, but if your rover tends to tip easily then set it much lower.
The rover developers will now start working on getting the documentation up to date, as it is woefully behind, but hopefully you will all be able to start driving now by using the auto-generated parameter documentation and the "advanced parameter list" configuration screen in Mission Planner.
Happy rovering!
Cheers, Tridge
Replies
Thanks.
This branch is more stable and mature than 2.30 ;-)
@ Andrew,
I have a question about the following new code....
New Auto Start options
...There is also a AUTO_TRIGGER_PIN option that allows you to set an input pin that can be used for a more gentle AUTO start. Attach a switch which shorts that pin to ground and you have yourself a start button for AUTO.
Does this mean that the Tx has to set the APM in Auto, or will this over ride the ch8 "Mode" input an set the rover in AUTO via on board manual switch?
John
Hi All,
I am running the latest ArduRover2 v2.40 code on my APM1.4/Oilpan with an uBlox LEA-6 GPS and it is performing pretty well. The learning mode works well and so does the auto mode. I did see steering dither as the rover drove from waypoint to waypoint. The dithering is very small in amplitude and appears to remain constant in amplitude and frequency. I did find that waypoint to waypoint travel offsets are very much a function of the HDOP. We had a partially cloudy day here in southern FL yesterday and the waypoint to waypoint offsets improved as the day's testing wore on, but the clouds definitely affected the number of satellites being received.
I am going to try the ArduRover2 v2.40 code on my APM2.5 today to see how it works with the compass on the APM pwb instead of on an aluminum mount above the rover chassis like on my APM1.4 board.
Regards,
TCIII
Really Great Tridge.
Will this new version work with PX4?
Ive got a second one coming and was hoping to use it with ArduRover.
Now that I have edit access to the new Wiki, I'll help with the documentation for ArduRover in addition to ArduCopter.
Excellent! And it's in the Mission Planner, too, which will make it easier for more people to join the beta test. Just in time for Sparkfun training. Go teams!
Huge thanks to Tridge, Tom, Linus, Greg and Steve.