The Main Goal

The robot mower project has been frustrating lately. I find myself working on problems that are easy to solve but ultimately unimportant. Like balancing the mower blades.

Problems like these are easy to focus on because solving them creates the illusion of progress. But in the big scheme of things, they’re peripheral to the main goal of the mower project: how do we make an autonomous robot lawn mower?

The robot I’ve built cuts grass autonomously if it has a clear view of the sky. It relies entirely on RTK GNSS to know where it’s at. If you put it under the maple tree in my front lawn, it will lose the RTK fix, and as it exists today, the robot can’t mow my lawn autonomously. So there remains work to do to achieve the primary goal of the mower project.

The robot needs another way to know its position when RTK GNSS isn’t available. That positioning method needs to be at least as accurate as the RTK GNSS position. There are a few ways this could be accomplished.

It’s possible we could rely on wheel encoders and the Pixhawk IMU to estimate the robot’s position by dead reckoning until we reestablish an RTK fix. But the longer you go without an RTK fix, the greater the position drift you’ll have to reconcile once you do reestablish the robot’s actual position.

You could minimize the drift by using some kind of visual odometry with a very high quality IMU. But this only conceals the underlying problem: you still don’t exactly know where the robot is at, and you don’t know when in the future you’ll rediscover its location with a new RTK fix.

Other solutions like LIDAR or depth sensing cameras require a companion computer to analyze the sensor data and send position estimates to the Ardupilot software. Which puts me at a big crossroad.

I’ve really enjoyed running Ardupilot on the Pixhawk due to its simplicity. But adding a companion computer complicates things greatly. If I’m going to be using ROS on the companion computer to do SLAM and send position estimates to Ardupilot, isn’t that just using ROS, but with more steps? I might as well just jump headfirst into trying to figure out ROS if that’s the choice I’m faced with.

The learning curve with Ardupilot was steep, but the learning curve with ROS appears almost insurmountable to me as a mechanical engineer. The upside, though, is that there are some things that you can only do with ROS at the moment, like using LIDAR for position estimation and integrating a depth sensing camera. So the education investment appears worthwhile.

From my cursory research, it appears that a 360° LIDAR sensor would complement the RTK GNSS positioning method very well. When something occludes the robot’s view of the sky, chances are it will be detectable on the LIDAR.

I haven’t even started considering obstacle avoidance. This is something else that ROS also seems to have more capability for than Ardupilot. But that’s a can of worms for another day. Let’s build a robot that can actually mow my lawn before we worry about crashing into my sprinkler system well again.

Can anyone speak to the accuracy of these thoughts? Any ROS users out there willing to chime in?

9 thoughts on “The Main Goal

  1. You’re correct that you’ve probably hit the limit of ardupilot+pixhawk and should bite the bullet and transition to ROS immediately. A 360 lidar will give you easy SLAM and obstacle avoidance with ROS at a decent price, but I would also consider depth cameras like Intel D435i, or even IR cameras like Flir. Many of the cameras come with neural nets out of the box for human detection. For just localization supplementation, look at “tracking” cameras like RealSense T265 (basically built-in visual SLAM.) You’ll also need more compute for these more advanced sensors – something like a Jetson Xavier NX, which is basically made for autonomous vehicles. Look at the MIT RACECARS project for a starting point. Good luck!


    1. Thanks for the feedback, Dan.

      Do you have any experience using the Intel RealSense T265? I’ve considered it in the past for this project. I like the concept: a black box that gives you position based on imagery. However, I’m concerned that it won’t work all that great outdoors, and that it won’t provide the accuracy I’m after even if it does work outside. Can you speak to these concerns?


  2. Hi,
    I also built my own mower robot (and it works), but I did not face the same issue.

    Even when my robot is under trees it does not lose RTK fixes, thanks to 2 things I took care about:
    – I am using a good RTK antenna, so a big one (14cm diameter) with low noise figure preamplifiers (<1.5dB).With this antenna I can tolerate a few dB attenuation. If I remember well yours is a smaller antenna, so probably less efficient.
    – I am using the 4 satellite constellations in order to have many satellites with many different angles of view. So I can lose some of them under a tree, but still keep other ones just over the horizon.

    You can also use IMU to keep heading well on a few meters using gyros and accel (it works, I tried it, but you have to build a very precise control loop to avoid drifts at any time; you can achieve mean drift as low as 5cm after 10m). But it is difficult to measure a very precise heading value with magnetometers to correct drifts, in particular with electrical motors working nearby (difficult but achievable with a lot of compensations). Iron parts are also bad for magnetometers, so my mower has few metal and no iron (except the motors themselves of course).

    Sorry for my english, but I'm french!



    1. I wouldn’t have known you weren’t a native English speaker had you not told me, Pierre!

      I agree about the magnetometer. They cause more issues than they solve in my opinion, at least with the type of robot I’m building. The motors create too much interference for them to be useful.

      What kind of GNSS antenna are you using? I’ve been wondering how much performance improvement I could get by using a better antenna. I might have to give that a try.

      I’ll have to do some “dead reckoning” testing to prove whether or not what I’ve written in this post is actually true. It’s not something I’ve actually tested. I might be surprised!


  3. Hi,
    I found my antennas (and my ZED-F9P mounted on arduino boards) on ardusimple site
    These products are very impressive at reasonnable price.
    Before using RTK my robot was working only with IMU (to follow parallel tracks) and an underground surrounding wire. So I can tell you it is achievable to follow one direction for 10 or 20 meters only with an IMU, but you will need a good control loop (because drifts are the sum of every moment deviation). In particular you will need to measure and compensate for lateral slopes (even gentle) in order to keep your average error to zero.
    This kind of project is very interesting, but not that easy…



  4. I might be off-topic, but:

    Have you looked into BLE AoA (Bluetooth low energy Angle of Arrival)? Or maybe other AoA methods to track the position of a beacon?

    Also, our Eufy L70 robot vacuum cleaner with a 360 lidar does an amazing job (inside) at mapping and keeping track of its position (can be viewed from cellphone app).Whe live in a 2-story hous and have one of these on each floor. Both run at the same time, no issues.

    If I had the time, I’d try and make a hybrid between the Eufy L70 and a robot lawn mower.

    One las thing: the most advanced RTK drones (DJI Agras T20 for expample, and I think the Matrice 300 too) have 2 RTK antennas, which enables them to very exactly calculate their heading even in strong magnetic interference, as they calculate the relative position of the 2 antennas instead of using the magnetometer.


  5. I’ve greatly enjoyed your blogs and project. Wished I had stumbled upon it sooner. I should disclose I am a comp sci drop out and have not built anything like this (although wished I had had the time/skill) but have thought about this problem for a long time.

    As has been suggested above, I would probably first focus on optimizing your RTK setup, followed by exploring a second setup for heading before exploring the possibility of a new modality for tracking.

    If you want to go to a new modality for tracking, I would also go with V-SLAM as suggested above as opposed to LIDAR. I think V-SLAM though would probably help counter other problems like little humans or animals running into the path. My limited experiences with LIDAR outdoors at least with consumer friendly budget have always left me wanting. Also with V-SLAM if you used a few fiducial markers in the target area (e.g. post with some kind of identification) at a known position then you would be able to know absolute position (I am sure requiring application of kalman filtering combined with last known RTK position).

    Finally, and also mentioned above, time of flight tracking also seems interesting (e.g. ESP S2) but I guess the argument could be made that the concept is very similar to RTK gps.

    Having young kids as well, and limited free time I think optimizing the platform you have and know might still be the way to go until you’re absolutely certain that you can’t take it further. I remember watching a James Bruton video in the past where he even seemed a little intimidated starting out with ROS.


    1. Thanks for the comments, fever. I’ve had a few conversations with folks that have used LIDAR and their sentiment is similar to yours: not great outdoors.

      I’ve been watching the OAK-D cameras at Luxonis, they have mentioned on the Ardupilot forums that at some point they will try to make them run visual inertial odometry out of the box. Might be several months to a few years before they get there, but if they do it should be pretty straightforward to integrate with a Pixhawk.

      I feel you regarding the kids, they do soak up the free time, but so far I haven’t regretted a moment spent with them. The mower project will be there a few years from now. Maybe they’ll want to help with it, and can help me figure out ROS!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s