5.1 C
Munich
Tuesday, May 6, 2025

USV Hercules vs Ajax: Get Ready for the Thrilling Match!

Must read

Okay, so yesterday I was messing around with some autonomous surface vehicles, right? Specifically, I was trying to get Hercules and Ajax to play nice together. It was a bit of a headache, but I figured I’d share my struggles (and eventual small wins) with you guys.

USV Hercules vs Ajax: Get Ready for the Thrilling Match!

The Setup: I had these two USVs, Hercules and Ajax. Hercules is a bit older, uses a clunky communication protocol, and Ajax is newer, fancier, with all the latest bells and whistles. My goal? Get them to coordinate on a simple task – basically, one follows the other.

First thing I did was get Hercules up and running. I had to dust off the old manuals and remember all the weird serial port settings. Seriously, who still uses those?! After about an hour of fiddling, I managed to get it talking to my laptop. I wrote a quick Python script to send it some basic commands: “go forward,” “turn left,” “stop.” Simple stuff.

Next up was Ajax. This one was supposed to be easier, since it has a REST API. Ha! Turned out the API documentation was outdated, and half the endpoints didn’t work as expected. I spent another hour reverse-engineering the API by sniffing network traffic. Eventually, I figured out how to control its speed and direction. Progress!

The Challenge: Now came the fun part – getting them to talk to each other, or rather, getting Ajax to follow Hercules. The problem was the communication gap. Hercules broadcasts its position over a slow, unreliable channel. Ajax needs precise, real-time data to avoid crashing into its buddy.

My Approach: I decided to use a central server as a bridge. Hercules would send its position to the server, and the server would relay that information to Ajax. I spun up a quick Flask app on my laptop to handle the data transfer. This involved writing code to parse Hercules’s messy data format, convert it to something Ajax could understand, and then push it to Ajax’s API.

USV Hercules vs Ajax: Get Ready for the Thrilling Match!
  • I started by creating a Flask endpoint to receive data from Hercules.
  • Then, I wrote a function to translate the data into latitude and longitude coordinates.
  • Next, I implemented another Flask endpoint that would send the coordinates to Ajax.

The Testing: I launched both USVs in my backyard pond (it’s bigger than you think!). Hercules started moving, sending its position updates to the server. Ajax dutifully received the data and tried to follow. It was… jerky. Really jerky. It would overshoot, correct, overshoot again, and generally wobble around like a drunk sailor.

The Tweaks: I realized the problem was the delay in the communication loop. By the time Ajax received Hercules’s position, Hercules had already moved on. I added some simple prediction logic to the server. Based on Hercules’s previous positions, the server would try to estimate where Hercules would be in the near future. It wasn’t perfect, but it helped smooth out Ajax’s movements.

I also played around with Ajax’s PID controller settings. PID controllers are notoriously tricky to tune, but after some trial and error, I managed to get Ajax to follow Hercules with reasonable accuracy. It wasn’t perfect, but good enough.

What I Learned:

  • Bridging legacy systems with modern ones is always a pain.
  • API documentation is rarely accurate.
  • Networking is always more complicated than you think.
  • A little bit of prediction goes a long way.

Next Steps: I’m planning to experiment with more sophisticated prediction algorithms and maybe even try using some Kalman filters. I also want to integrate a GPS module on Hercules to get more accurate position data. But for now, I’m calling it a day. Hercules and Ajax are (mostly) friends, and that’s good enough for me.

USV Hercules vs Ajax: Get Ready for the Thrilling Match!

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article