|(48 intermediate revisions by the same user not shown)|
= MAE 148 Team 1 ==
Project Team Members
- Maximilian Apodaca - Computer Engineering
- Daniel (Wei Te) Ha - Mechanical Engineering
- Kaifan Yue - Mechanical Engineering
We set out to build a robot that can find its way to the user in a safe an reliable manor. In particular we were hoping to follow predefined GPS paths and avoid people along the way.
The project started by exploring two separate problems, detecting people and following a GPS path. Luckily for us the GPS path following had a rudimentary solution produced by the NotKiwiBot team. For the person detection we found a helpful tutorial online.
With these two problems solved we went about trying to integrate a new RTK GPS and the vision tracking into NotKiwiBot's code. A first draft of this was easier than expected as we only had to take control of the path planner when we saw a person.
After the first test integration we modified NotKiwiBot's path planner to run at a fixed speed (vs a fixed throttle) and applied some changes to decrease the wobble the car experiences while driving.
We have almost a standard schematic with the inclusion of the RTK GPS.
- 3D Printed Parts
- Camera Mount and Protection Case
Our team designed camera mount that can easily adjust height and angle. During our use, the camera mount perfectly satisfied our need to finding best camera position for track training and later people detection.
We also tailor-made a protection case for the camera unit. It fits perfectly and can protect the whole unit as well as the lenses. The drawing is attached below.
- Camera Mount and Protection Case
The RTK GPS unit that we purchased is very expensive and powerful and we want to avoid any damage to it so that future teams can use it. You can download can print the case here:GPS Case and GPS Base
All the software is on Github https://github.com/Pumuckl007/ECE148Car
The RTK GPS works in a similar manor to a regular GPS. We communicate with it via a serial port and pass the standard NMEA messages. However it has additional functionality to handle RTCM data. RTCM is a way to send location correction data to the GPS. We implemented a client to handle (an NTRIP Client) this but did not end up using it.
As a result the code to read from the GPS amounts to opening a serial port with PySerial and parsing the NMEA with PyNema2. This has been documented with all the past GPS teams.
It is important to note that the RTK GPS we are using (C099-f9p) has a built in IMU to give high resolution movement data. That is to say it gives very high resolution movements but without RTK turned on can be up to a meter off in absolute position.
The path following we used is very simple and almost identical to NotKiwiBot's implementation. Pick a look-ahead point and try and drive towards it. We do this by trying to match the direction of our car's motion to the direction to the point. This is illustrated in the figure below.
Each time we get close to the look-ahead point, which is within 5 meters in our case, we move the look-ahead point along the path we are trying to follow. This keeps the car targeting a point close enough to make a difference. The code for this can be found in the planner.py file.
Bearing From GPS
In order to find the bearing of the car we need to sample GPS data. However at low speeds this can be very noisy. As a result we take the centroids of the last two sets of two GPS coordinates and use that to extract heading information. For instance if we had the points [(1,1.8),(2,2.2),(3,2.2),(4,1.8)] we would compute the averages of the first two and last two points to get (1.5,2) and (3.5,2) and see that we are heading due west. If we just took that last two points (1,1.8),(2,2.2) we would assume we are heading south west.
Indoor Autonomous Driving
Outdoor Autonomous Driving
Path Following via GPS
- Enable RTK to remove 1 meter absolute error
- Handle people that are further away (right now there is a 4 meter limit)
- Add sensor to stop before hitting a curb
- Adapt speed based on turning radius
- PID Controller for Steering to prevent wobble
- Tune GPS Update Rate
- Extrapolate position based on velocity to increase angle accuracy
Advice for Future Teams
NTRIP is really simple but there is little documentation. Just do a streaming get request to rtk2go.com:2101/<ENDPOINT_NAME> and periodically feed new NMEA data.
Implementing a controller for speed is highly recommended if your car can go on grass. We did not have this and had to push it every time it went off the concrete.
GPS is inaccurate in the EBU II building. Like it is really bad. However if you are using the C099-F9P you can still get very acurrate movement information. The absolute position will just be off and drift over time.
The C099-F9P gives really accurate data. Like we were surprised how well the IMU is integrated into the GPS data. Before you go trying to put an encoder or some secondary form of distance measuring try it with just the GPS. We were able to resolve 4 cm movements easily.
UBX is not necessary, you can set the settings by using u-center. u-center also runs great under wine, just use wine-tricks to set the windows version to 10.