Copper2
Posts: 1
Joined: Tue Apr 24, 2018 11:17 pm

Making robot follow gps

Tue Apr 24, 2018 11:25 pm

Could someone help me with my question, I want to make an autonomous ROV that’s like a submersible. I want it to have a fish finder to read the world around it and cameras, lights, pir sensors, and a gps. Is it possible to make it track it’s position when it surfaces and then go to a destination and back? Could anyone help me with a code that could work, I’m very new to raspberry’s and I’m more used to arduino which still baffles me somewhat!

User avatar
topguy
Posts: 4754
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Making robot follow gps

Wed Apr 25, 2018 11:57 am

Is it possible to make it track it’s position when it surfaces and then go to a destination and back?
I'm not sure you understand how much engineering is needed just to make something that can go underwater and come up again.

As long as your robot can move and you can control which compass direction it is heading in, then its not that hard to have it go from one GPS location to another. Its just a bit of vector math, not hard compared to all the other stuff you need to do to have a moving "boat" in the first place.

PiGraham
Posts: 3391
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Making robot follow gps

Wed Apr 25, 2018 1:00 pm

You might get aswers to specific issues for underwater ROVs at https://www.openrov.com/
Last edited by PiGraham on Wed Apr 25, 2018 2:53 pm, edited 1 time in total.

B.Goode
Posts: 6356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Making robot follow gps

Wed Apr 25, 2018 1:49 pm

I want it to have a fish finder to read the world around it and cameras, lights, pir sensors, and a gps. Is it possible to make it track it’s position when it surfaces and then go to a destination and back?
Once you have got your current location from the GPS, how will you plot a route to the destination? Will you need to add a compass to your list of equipment, so you know which way to travel?
Could anyone help me with a code that could work, I’m very new to raspberry’s and I’m more used to arduino which still baffles me somewhat!

Your requirements are very specific, with a lot of components. I seriously doubt anyone will have done a project exactly like this to the point where sharing a finished program would be possible or useful.

You might get lots of help if you ask questions that are more limited in their scope.

I share your bafflement with Arduino. Just a microcontroller that can only execute a single script at a time, and where the code has to be developed elsewhere and then uploaded to the chip to test it. Compare that to an RPi that can run an entire Operating System, allows you to run multiple scripts simultaneously, and does 'develop and test' on the same machine. Yes, I'm baffled why anyone would want an Arduino! (Apart from the predictable real time execution and the built-in ADC and the low power draw... !)

[Just kidding... Horses for Courses and all that..]

hippy
Posts: 3598
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Making robot follow gps

Wed Apr 25, 2018 2:04 pm

Copper2 wrote:
Tue Apr 24, 2018 11:25 pm
I want to make an autonomous ROV that’s like a submersible.
That's quite an ambitious project and, if you are baffled by Arduino, would probably be a project beyond you at present.

That's not to say you can't do it or won't ever be able to but it would be best to set your sights on simpler projects first. As you get to grips with those you will build up the skills needed to do your ROV project, gain a better understanding of what needs to be done and how to do it.

One thing to bear in mind is that the Pi is not designed for low power or battery operation which is something which is likely to be important in an autonomous ROV. An Arduino or something similar may actually be a better choice than a Pi.

User avatar
bensimmo
Posts: 3118
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Making robot follow gps

Wed Apr 25, 2018 2:47 pm

Start with connecting a GPS and getting coordinates.
Then get a magnetometer/compass and get that working.

Get a camera and get that working.

Then lights and PIR .... working.

Most the code is in the tutorials on the site, be it via a SenseHAT for the compass (you can do then in emulation so you get a feel of what can be done, e.g. for the compass)
Then get something else and adapt the code you know how to use and look for.
Look at gpiozero versions for the lights and PIR.

Ghost hunting or something like that to read the GPS.

Then it thinking time of how it all works together.
I assume down motors and servo will be needed.. again in the education area and probably gpiozero again.

Step by step.
Getting it to all work together.....

pcmanbob
Posts: 4268
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Making robot follow gps

Wed Apr 25, 2018 10:53 pm

With such a complex project I would suggest you break it down in to smaller projects and may be start with a wheeled robot on dry land once you have all the gps/navigation problems solved then move on to your underwater ROV.

Its much easier to retrieve a failed rover on dry land than from the bottom of a lake or the sea.
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

PiGraham
Posts: 3391
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Making robot follow gps

Thu Apr 26, 2018 6:53 am

If your ROV could tow a buoy you could put the GPS receiver in the buoy and have a positional fix all the time. This could also allow you to stay in radio contact and make recovery much easier if something goes wrong.

Guidance underwater is probably difficult since fixed references may not be available. You can't use typical dead reckoning methods of heading and speed unless you know what currents are also moving the vehicle.

If you have sonar that can map the sea floor that may give you a reference, but I imagine it will be tricky do and variable.

If you have GPS position and heading navigation could be fairly simple trigonometry. GPS position will be degrees of eastings and northings which are like X and Y on a graph over small distances.
Turn to a heading that points to the destination and move ahead. Correct heading as you go and stop forward motion once you get within some distance of the destination coordinates. You might use a PID control loop to correct the steering.
Recalculate course as you go in case there is drift. More advanced guidance could measure any drift and correct for it by offsetting the destination by how much you would miss by over the estimated route and them aim for the drift-corrected destination. If the drift stays the same and the estimate of time was accurate you should arrive on target.

Return to “General programming discussion”

Who is online

Users browsing this forum: No registered users and 6 guests