Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel lukas #42

Open
wants to merge 207 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
ad38549
Added GPS to state estimation. Adapted state estimation (individual m…
maxb91 Sep 13, 2016
1267bef
Added DS_Store to gitignore
maxb91 Sep 13, 2016
c747492
Added Localization node
maxb91 Sep 13, 2016
7cbb91f
Added first draft of LMPC node. Not tested yet.
maxb91 Sep 13, 2016
291dde6
Added indoor GPS package
maxb91 Sep 13, 2016
06a8fc3
Fixed localization node (fixed wrapping error) and added position inf…
maxb91 Sep 13, 2016
05715bf
Added MPC node for trajectory following and MPC-logging message forma…
maxb91 Sep 13, 2016
002eed5
added observers file (necessary for state estimation)
maxb91 Sep 13, 2016
526ffbe
Added Barc simulation node, still needs launch-file to be started (to…
maxb91 Sep 13, 2016
a37e2ec
Merge branch 'devel-max' of https://github.com/BARCproject/barc into …
maxb91 Sep 13, 2016
0ae2712
Merge branch 'devel-max' of https://github.com/BARCproject/barc into …
maxb91 Sep 13, 2016
c165956
Merge branch 'devel-max' of https://github.com/BARCproject/barc into …
maxb91 Sep 13, 2016
adfbaaf
added launch file for MPC-follow-trajectory simulation
maxb91 Sep 13, 2016
d23fefa
deleted outlier detection in state estimator (didn't work properly) a…
maxb91 Sep 13, 2016
574decb
changed paths of log files to make them platform-independent
maxb91 Sep 14, 2016
69705dd
Merged with branch devel-felix and did little cleanups
maxb91 Sep 14, 2016
99c8fd9
Added addition logging to simulator (logs measurements, estimation an…
maxb91 Sep 15, 2016
b1b5ab5
Merge branch 'MPC-follow-trajectory' of https://github.com/BARCprojec…
maxb91 Sep 15, 2016
b566d4b
Changed message format to float64, added s_start to message pos_info,…
maxb91 Sep 15, 2016
1bb4eae
Modified racetrack creation: Start/Finish is at middle of straight li…
maxb91 Sep 15, 2016
afc1d78
Transposed matrices so that they're ordered columnwise (instead of ro…
maxb91 Sep 16, 2016
1ec68f3
reduced number of matrices in coeffConstCost to make calculations fas…
maxb91 Sep 16, 2016
875df3a
Added profiler LMPC function (just for simulation and profiling), add…
maxb91 Sep 16, 2016
192906a
Changed subscriber so that it writes into passed arguments instead of…
maxb91 Sep 16, 2016
0ae8cde
Changed entire problem formulation structure so that there are no mor…
maxb91 Sep 17, 2016
de561fd
LMPC simulation works with multiple laps. Still oscillating a bit aro…
maxb91 Sep 19, 2016
3b8bff8
Added evaluation functions, changed tabs to spaces (in python code), …
maxb91 Sep 20, 2016
753de90
Added function to create smoother tracks (continuous derivative of cu…
maxb91 Sep 20, 2016
38b48de
Changed cmd-publish structure so that commands are published at the b…
maxb91 Sep 20, 2016
6d15f5b
Added new method to model racetrack (by stacking curves together). Ch…
maxb91 Sep 20, 2016
e06975c
Added method to create racetracks with Bezier curves.
maxb91 Sep 21, 2016
7752f6e
Added Bezier function to create racetracks (didn't work at previous c…
maxb91 Sep 21, 2016
fd3c33b
Added more tools to analyze predictive control. Currently no perfect …
maxb91 Sep 21, 2016
a7fe1f1
Working version. LMPC learns and is stable (if the parameters are cho…
maxb91 Sep 23, 2016
9911110
Added precompiling (to speed up code) and evaluation functions (to vi…
maxb91 Sep 23, 2016
6305f58
Working version of LMPC. Works well with wide track (about 0.6m width).
maxb91 Sep 24, 2016
ff13d4b
Modified state estimation: predicts state by 0.1s (linear prediction)
maxb91 Sep 24, 2016
4303291
Added dynamic model to state estimation. Added evaluation functions t…
maxb91 Sep 28, 2016
af828ea
added dynamic system to simulator. Not yet working properly.
maxb91 Sep 28, 2016
02a25a0
Changed simulation model to dynamic model (including dynamic steering…
maxb91 Sep 28, 2016
c683172
Merge branch 'dynamic-estimation' into dynamic-simulation
maxb91 Sep 28, 2016
58bb34a
Added dynamic estimator to dynamic simulation. Might need some tuning…
maxb91 Sep 28, 2016
bf3d27e
Merge with LMPC
maxb91 Sep 29, 2016
b700ef9
Added predictive dynamic estimator
maxb91 Sep 29, 2016
1bdff90
Deleted files and replaced them with the submodule
maxb91 Oct 6, 2016
804307f
Merged (dynamic) simulation node with submodule
maxb91 Oct 6, 2016
3f904f0
Updated submodule reference
maxb91 Oct 6, 2016
56ca47b
Adapted LMPC node to new submodule. LMPC node now uses dynamic estima…
maxb91 Oct 6, 2016
ffe385f
Updated submodule.
maxb91 Oct 6, 2016
09e9959
Adapted evaluation and added psi measurement to Kalman filter. LMPC w…
maxb91 Oct 7, 2016
f661744
Small changes in simulation model
maxb91 Oct 7, 2016
4e2157c
Small changes in evaluation and logging, changed queue-sizes to 1, ad…
maxb91 Oct 10, 2016
8871526
Combined position and ey-epsi-estimation in one node and deleted loca…
maxb91 Oct 10, 2016
590e263
Adapted to new submodule, went back to GPS estimation only (no yaw or…
maxb91 Oct 11, 2016
3d03726
Added one-step error logging
maxb91 Oct 11, 2016
b50cdf4
Added launchfile for BARC
maxb91 Oct 11, 2016
25030ab
Added env loader for odroid
maxb91 Oct 11, 2016
49d5d40
Added env loader for pc
maxb91 Oct 11, 2016
2119b75
Corrected low-level controller
maxb91 Oct 11, 2016
23fd5c9
Fixed 64/32bit issue, completed launchfile.
maxb91 Oct 11, 2016
07311df
Added node to record sensor and command data.
maxb91 Oct 12, 2016
0f9c190
Added julia functions to analyze recorded data.
maxb91 Oct 12, 2016
bf66b83
Added sensor test launchfile.
maxb91 Oct 12, 2016
8dbf111
Fixed bug so python scripts work on odroid as well.
maxb91 Oct 12, 2016
7c97c1a
Simplified dynamic state estimation: Only position info is published.…
maxb91 Oct 12, 2016
9ef7b53
Changed Arduino code to send average velocity (from encoders), adapte…
maxb91 Oct 13, 2016
9a8b91c
Fixed arduino code. Somehow only 2 of 4 magnets are recognized by enc…
maxb91 Oct 13, 2016
baee219
Estimator: added option to account for yaw drift. Fixed wrapping erro…
maxb91 Oct 14, 2016
6c6ad26
Added official marvelmind-package to receive gps-data. Adapted subscr…
maxb91 Oct 14, 2016
a375478
Optimized julia codes for speed, cleaned code.
maxb91 Oct 15, 2016
975f204
Improved simulation model (added artificial sensor disturbances)
maxb91 Oct 16, 2016
93728b7
Introduced extrapolation of GPS and psiDot values, added outlier dete…
maxb91 Oct 19, 2016
3b2f76b
Cleaned code (first time working with Lint)2
maxb91 Oct 19, 2016
1b5bfd1
Added headers to custom messages and adapted code accordingly. Restru…
maxb91 Oct 20, 2016
3c98c68
Switched to ROS time as global clock. Messages are logged with publis…
maxb91 Oct 20, 2016
2fe7857
Cleaned code, added open loop julia control file.
maxb91 Oct 20, 2016
61bbe8b
Restructured logging strategy, fixed open loop simulator/recorder.
maxb91 Oct 20, 2016
344252a
Updated submodule.
maxb91 Oct 20, 2016
430948b
Deleted obsolete messages (fixes rosserial make_libraries bug).
maxb91 Oct 21, 2016
5541ee4
Fixed arduino code.
maxb91 Oct 21, 2016
93d4982
Added variables to pos_info, adapted Arduino code to 3-wheel decoders.
maxb91 Oct 25, 2016
b8ef2c9
Added Kalman filter simulation scripts. Changed estimation to adaptiv…
maxb91 Oct 27, 2016
7525b96
Added Kalman variations for testing.
maxb91 Oct 28, 2016
17a2ccc
Added more evaluation scripts and Kalman filter variations. Adapted v…
maxb91 Nov 2, 2016
98f0123
Added 4-wheel encoder logging, added simpler kinematic estimator (not…
maxb91 Nov 3, 2016
fb0d6bc
Fixed arduino code, extended evaluation scripts
maxb91 Nov 4, 2016
0b51006
Fixed Arduino code.
maxb91 Nov 4, 2016
659b059
Added simple track, added 2-step-delay to Kalman filter, adapted eval…
maxb91 Nov 9, 2016
52a9adb
Started working on more general oldTraj structure.
maxb91 Nov 9, 2016
28d5d69
Removed s_start
maxb91 Nov 9, 2016
8615de7
Merged no-s-start
maxb91 Nov 9, 2016
58aa4f9
Changed oldTraj structure
maxb91 Nov 10, 2016
4aabff9
Added pure sensor-based Kalman filter (good performance in tests), ra…
maxb91 Nov 11, 2016
a555836
Updated low level control parameters, normalized acceleration measure…
maxb91 Nov 12, 2016
77fa57d
Updated parameters
maxb91 Nov 18, 2016
b3c0ea9
Optimized Localization helpers
maxb91 Nov 28, 2016
d2f7229
Added perfect state information for simulation, added evaluation func…
maxb91 Nov 28, 2016
7d34583
Updated Kalman filter and Kalman filter simulation.
maxb91 Nov 28, 2016
487a3fb
Added evaluation functions (incl. animation)
maxb91 Nov 30, 2016
6ea5b07
Updated parameters and wifi settings.
maxb91 Dec 1, 2016
df7a79d
Updated paramters
maxb91 Dec 2, 2016
37be4e6
Went back to 4-parameter xDot sysID, updated plots.
maxb91 Dec 4, 2016
22a5af0
Added filtered state in LMPC and evaluation
maxb91 Dec 4, 2016
cb8e506
Fixed filter formulation.
maxb91 Dec 4, 2016
f121503
Last optimizations.
maxb91 Dec 5, 2016
f2b8442
Updated localization (decreased polynomial to 3rd order), added debug…
maxb91 Dec 6, 2016
70923be
Good tuning.
urosolia Dec 6, 2016
9d9105a
Updated localization parameters
urosolia Dec 6, 2016
0614ced
Updated localization parameters, increased oldTrajectory buffer for h…
urosolia Dec 6, 2016
ffe35b1
Added evaluation functions for thesis.
maxb91 Dec 7, 2016
47764b4
Merge branch 'acc-filter' of https://github.com/MPC-Berkeley/barc int…
maxb91 Dec 7, 2016
e5283d8
Added evaluation functions.
maxb91 Dec 8, 2016
63f74f7
Deleted submodule, replaced it with normal directory
maxb91 Dec 8, 2016
ad1878b
Cleaned source code, added Readme file.
maxb91 Dec 9, 2016
dd80add
Cleaned evaluation folder and added Readme.
maxb91 Dec 15, 2016
ba0e33e
Changing reference speed in path following as the motor performance h…
urosolia Dec 15, 2016
bfb4c45
Settings used for video (1/15/17)
urosolia Jan 16, 2017
724618f
Video settings, 2nd day (1/16/)
urosolia Jan 16, 2017
7c0fd32
Commit after merge, video settings day 2
urosolia Jan 16, 2017
0ed89ab
Experimtne second day final (1/16/2017)
urosolia Jan 16, 2017
bf81da2
Add small comment
urosolia Jan 16, 2017
6d82309
Fix bug in equation for simulatior
urosolia Jan 17, 2017
505c062
Changing uncertanty values
urosolia Feb 20, 2017
2b3fa67
Adding a tutorial for date evaluation
urosolia Feb 20, 2017
720b5f4
new tuning
urosolia Apr 26, 2017
859e3f2
changes 26 sept 17
francescoricciuti Sep 26, 2017
a4d907a
changed frequency of pos_info, refined tuning, refined system ID
francescoricciuti Nov 8, 2017
ed51a0e
first steps towards obstacle avoidance
francescoricciuti Nov 9, 2017
5bc8bf5
new tuning
francescoricciuti Nov 14, 2017
6592997
new plot functionalities
francescoricciuti Nov 15, 2017
486f304
added slack variables to the problem, new tuning, now working
jonmgonzales Nov 16, 2017
9ea3c20
new tuning
jonmgonzales Nov 17, 2017
3b33574
added working obstacle avoidance
jonmgonzales Nov 21, 2017
6df6d65
minor changes to plotting
jonmgonzales Nov 22, 2017
1a8ffa9
modified scripts for connection with arduino and minor changes on the…
jonmgonzales Dec 4, 2017
f4497fa
new tuning
jonmgonzales Dec 4, 2017
aa52c0f
added env loader script and testing code for LMPC
jonmgonzales Dec 8, 2017
87b2eac
setup for experiments
jonmgonzales Jan 16, 2018
b3b679b
minor changes
jonmgonzales Jan 17, 2018
a680929
new tuning
jonmgonzales Jan 18, 2018
1999837
small changes to plots for debugging
jonmgonzales Jan 18, 2018
80fddcb
added codes for mapping of accelleration
jonmgonzales Jan 22, 2018
fd011ac
modified track
jonmgonzales Jan 22, 2018
564e031
changed settings for mapping tests
jonmgonzales Jan 23, 2018
3d1732f
small changes for mapping
jonmgonzales Jan 23, 2018
bef7bb0
added script for deceleration mapping
jonmgonzales Jan 24, 2018
168db48
added plots for debugging
jonmgonzales Jan 25, 2018
d9097d3
minor changes in plots
jonmgonzales Jan 25, 2018
30e11be
new plots added
jonmgonzales Jan 26, 2018
595f5a4
minor corrections on plots
jonmgonzales Jan 27, 2018
f08a99c
new tuning
jonmgonzales Jan 29, 2018
e4783d9
new tuning
jonmgonzales Jan 30, 2018
120a3a9
restored original track
jonmgonzales Jan 30, 2018
b7e2a64
New changes for new GPS pkg
urosolia Feb 1, 2018
a8b0ba0
tuning
jonmgonzales Feb 2, 2018
81f05a5
Merge branch 'obstacle_LMPC' into obstacle_LMPC
francescoricciuti Feb 2, 2018
0d44aef
Merge pull request #30 from francescoricciuti/obstacle_LMPC
urosolia Feb 2, 2018
1d27f32
tuning for simulator
jonmgonzales Feb 5, 2018
2c54c0f
Merge branch 'obstacle_LMPC' of https://github.com/francescoricciuti/…
jonmgonzales Feb 5, 2018
56f2e5e
new tuning for experiments
jonmgonzales Feb 6, 2018
3bd19a8
Merge pull request #33 from francescoricciuti/obstacle_LMPC
urosolia Feb 6, 2018
49dbeb8
added solver status to plots
jonmgonzales Feb 7, 2018
8ea3ac3
new tuning for experiments
jonmgonzales Feb 8, 2018
ecba949
new tuning for simulation
jonmgonzales Feb 10, 2018
657e2a5
Merge pull request #34 from francescoricciuti/obstacle_LMPC
urosolia Feb 10, 2018
149e37b
Good Tuning
urosolia Feb 10, 2018
62d954d
added boolean variable for obtacle tuning
jonmgonzales Feb 12, 2018
605e74e
added plots for obstacle avoidance
jonmgonzales Feb 13, 2018
159d4e7
Merge branch 'obstacle_LMPC' into obstacle_LMPC
urosolia Feb 13, 2018
9da2101
Merge pull request #35 from francescoricciuti/obstacle_LMPC
urosolia Feb 13, 2018
34fe374
cleaning code from useless lines. CHECK TUNING BEFORE MERGING WITH BASE
jonmgonzales Feb 16, 2018
db7e652
Latest Tuning
urosolia Feb 16, 2018
4c11138
added one lap for system ID
jonmgonzales Feb 17, 2018
24143c7
Merge branch 'obstacle_LMPC' of https://github.com/francescoricciuti/…
jonmgonzales Feb 17, 2018
7771e72
best tuning
jonmgonzales Feb 17, 2018
ac91d9d
Merge branch 'obstacle_LMPC' into obstacle_LMPC
urosolia Feb 17, 2018
7f8502a
Merge pull request #40 from francescoricciuti/obstacle_LMPC
urosolia Feb 17, 2018
84362eb
Good Tuning
urosolia Feb 17, 2018
a98e9c1
Changes in eval function
urosolia Feb 17, 2018
9fe7845
remote commit for francesco
jonmgonzales Mar 1, 2018
7b71146
remote commit for francesco
jonmgonzales Mar 1, 2018
3279fac
Setting up communication for two machines for testing
lukasbrunke Mar 16, 2018
0cf19e7
syncing connection test files
lukasbrunke Mar 16, 2018
9a2848f
Fixed the crashing of the visualization and added a test for pubslish…
lukasbrunke Mar 19, 2018
b0c95e0
Merge branch 'devel-lukas' of https://github.com/lukasbrunke/barc int…
lukasbrunke Mar 19, 2018
58220cc
preparation for publishing obstacle states
lukasbrunke Mar 19, 2018
7652f9f
merged files
lukasbrunke Mar 19, 2018
3a312fa
Added node for sending obstacle information
lukasbrunke Mar 20, 2018
e9c2670
Initial commit for running multiple agents.
lukasbrunke Apr 30, 2018
92d1d9f
Updated environment loaders
lukasbrunke Apr 30, 2018
829f371
Adding some visualization tools for debugging recorded data.
lukasbrunke May 4, 2018
a3ecc0c
Tuning from experiments
lukasbrunke May 17, 2018
801cbb5
Merge branch 'devel-lukas' into devel-lukas
urosolia May 17, 2018
d5ff0e1
Delete OA
lukasbrunke Sep 23, 2018
4ba3bf5
Updating branch to current status and adding dependency file
lukasbrunke Sep 23, 2018
615bbd0
adapt readme for installing dependencies
lukasbrunke Sep 23, 2018
1818846
Merge branch 'devel-lukas' of https://github.com/lukasbrunke/barc int…
lukasbrunke Sep 23, 2018
402d86c
updating code base
lukasbrunke Sep 23, 2018
e8d77c4
deleting unused files
lukasbrunke Sep 23, 2018
b12394b
Merge branch 'devel-lukas' of https://github.com/lukasbrunke/barc int…
lukasbrunke Sep 23, 2018
be94875
Deleted specified machines for simulation launches and removed not ne…
lukasbrunke Sep 23, 2018
d685aac
Added instructions for how to get access to get_name from RobotOS
lukasbrunke Sep 23, 2018
061eef3
Specified file in readme
lukasbrunke Sep 23, 2018
0b1a538
removed hard-coded paths, extended readme
lukasbrunke Sep 24, 2018
14a5b84
Accessing get_names() from RobotOs now
lukasbrunke Nov 11, 2018
b45588d
Added config.yaml which can be read from both python and julia files,…
lukasbrunke Nov 11, 2018
58710b8
Fixed typo
lukasbrunke Nov 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ controller.py
Dator/db.sqlite3
workspace/src/barc/rosbag/
*.ropeproject/
.DS_Store

# recordings and images
images/
recordings/
predictions/
File renamed without changes.
97 changes: 43 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,52 @@
# Berkeley Autonomous Race Car (barc) Repo
# Learning Model Predictive Control (LMPC) for Multi-Agent Competitive Autonomous Car Racing

The Berkeley Autonomous Race Car is a development platform for autonomous driving to achieve complex maneuvers such as drifting, lane changes, and obstacle avoidance. A 1/10 scale RC car and an embedded Linux computer make up the hardware platform of the project. This project aims to be fully open-source. The data collection process is cloud-based and brings new dimensions to the Vehicle Dynamics and Control Theory teaching and research world.
This repository implements learning model predictive controllers for racing multiple agents competitively on a given race track in simulation or on the Berkeley Autonomus Race Car platform (BARC).

This site is home to the repository. The main site for the project is [here](http://www.barc-project.com/).

## Organization
The primary folders in this repository include
* docs
* Overview about the mechanical, electrical, and software deign of the vehicle. Descriptions of the vehicle models used for some control algorithms
* CAD
* DWX files for fabricating the deck and side brackets for the chassis, and STL files for fabricating the sensor mounts (e.g. hall effect sensor, camera, ultrasound) and the cover for the odroid.
* Dator
* Web server for cloud robotics. Provides a standard way to record data and events from one or more local computers for later analysis. Based on [this repo](https://github.com/bwootton/Dator) from Bruce Wooton
* arduino
* Files to program the arduino to (1) send commands to the electronic speed control (ESC) unit and the servo, and to (2) acquire measurements from the encoders and ultrasound sensors</span></li>
* scripts
* Bash programs that set up environment variables and launch the local server upon boot
* MATLAB
* Useful MATLAB scripts for processing ROS bag file. The bag files store all the message data (time stamped sensor measurements, actuator commands, etc) during an experiment
* workspace
* **Robotic Operating System (ROS)** workspace that contains the barc package. This package holds the source code to control the vehicle using the ROS framework

All software to control the vehicle resides in the *Arduino* and *Workspace* folders.


## Getting started
1. Get the parts, [list](https://github.com/BARCproject/barc/blob/master/docs/BillofMaterials.md)
2. Flash the odroid, [instructions](https://github.com/BARCproject/barc/blob/master/docs/FlashingEMMC.md)
3. Assemble the car, [instructions](https://docs.google.com/document/d/1T8O4JhUlw09ALUGPSX7DlSO7Hc7vcKl_ahBeHncMguE/edit?usp=sharing)
4. Charge the battery, [instructions](https://github.com/BARCproject/barc/blob/master/docs/ChargingBattery.md)
5. Connect to the RC remotely, [instructions](https://github.com/BARCproject/barc/blob/master/docs/ConnectingToOdroid.md)

You can also scroll through the material under our docs section to find other useful information
## Installing dependencies
After installing python and ROS, go ahead an install julia version 0.4. This package has only been tested using ROS kinetic and julia version 0.4.7. Older julia versions can be found [here](https://julialang.org/downloads/oldreleases.html). This package requires a couple of packages, which can be installed with the following command:
```
julia <path_to_barc>/dependencies.jl
```

## Useful resources
### Troubleshooting
Build Errors in the Gtk-package while installing the ProfileView-package can be resolved by running the following line in a separate terminal
```
sudo apt-get install libgtk-3-dev
```
followed by
```
Pkg.build("Gtk")
```
in the julia shell.

Recommended reading and resources
+ [A Gentle Introduction to ROS](https://cse.sc.edu/~jokane/agitr/), by Jason M. O'Kane, and this [basic tutorial](http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29) for writing ROS nodes in python
+ [Julia JuMP](https://jump.readthedocs.io/en/latest/), Mathematical Programming using the Julia programming language
+ [Git - the simple guide](http://rogerdudler.github.io/git-guide/), or for a more in-depth reading, consider [this](https://www.atlassian.com/git/tutorials/ ) tutorial by Atlassian
+ [Electronic Speed Control (ESC) manual](http://propeleris.lt/failai/wp-s10c-rtr_manual.pdf), which details how to calibrate and program the ESC
+ [Open source ESC](http://vedder.se/2015/01/vesc-open-source-esc/), for building your own ESC
+ [Pulse Wide Modulation (PWM)](http://www.egr.msu.edu/classes/ece480/capstone/fall14/group07/PDFs/PWM_Application_Note.pdf), notes from Michigan State ECE480 class, explaining the concept of PWM and its usage in an arduino.
+ [Arduino Servo Library](http://makezine.com/2014/04/23/arduinos-servo-library-angles-microseconds-and-optional-command-parameters/), article by Make magazine, clarifying the usage of some functions within the library
+ [Mass moment of inertia calculation](http://www.mathworks.com/company/newsletters/articles/improving-mass-moment-of-inertia-measurements.html), a MATLAB newsletter explaining how to estimate the mass moment of inertia
+ [Computer Vision lecture series](https://www.youtube.com/watch?v=N_a6IP6KUSE), from Professor Peter Corke aat Queensland University of Technology
## Configuration
### Add HOME_DIR environment variable
Create the environment variable HOME_DIR, which is a string which points to your home directory/the directory which includes the barc folder. Create a julia configuration file, if you do not have one already:
```
cd
vim .juliarc.jl
```
and add the following line:
```
ENV["HOME_DIR"] = <path_to_your_home_folder>
```

## Student projects
+ [Lane Keeping and Obstacle Avoidance](https://github.com/ych09041/me131lane), with [ demo](https://www.youtube.com/watch?v=5HKu7AaSsoM), by Tony Abdo, Hohyun Song, Cheng Hao Yuan, UC Berkeley ME 131, Spring 2016
### Config file
The config.yaml file allows for multiple different settings.
* mode: One of ["path_following", "learning", "racing"]
* initialization: One of ["inner", "center", "outer"]
* track_name: One of ["oval", "l_shape"]

## Potential issues
### Bad IMU magnetometer readings
The magnetic field around car, perhaps from the motor or aluminum deck, may interfere with the magnetometer readings, meaning the roll, pitch, yaw measurements may be off
### Launch file
The parameters delay_df and delay_a specifiy the delay for the steering and the acceleration in the controller and in the estimator. For the controller they are given in time steps (value="1") and for the estimator in seconds (value="0.1"). The parameters time_offset specify how long after the initialization the agent should wait before applying control inputs. This allows the two agents to start at different times.

### Wrong internal clock time / date
The time and date settings on the odroid may be incorrect. This may be because the [Real Time Clock (RTC) battery](http://www.hardkernel.com/main/products/prdt_info.php?g_code=G137508214939) is not connected or has a loose connection. To update the date / time settings, ensure the RTC battery is firmly connected, and ensure you are connected to the Internet via wifi or ethernet. Next, open a terminal and run the following network time protocol (ntp) commands
## Running the code
### Simulation Agent
To run agent 1 in simulation execute the following command:
```
roslaunch barc sim_agent_1.launch
```
For path following MPC set MODE to "path_following" and for learning set MODE to "learning". This runs the agent on the track and records the data. Notice that you have to run the command first in the path following mode to collect data for LMPC. To run agent 2 in simulation run the following command:
```
sudo service ntp stop
sudo ntpdate -s time.nist.gov
sudo service ntp start
roslaunch barc sim_agent_2.launch
```
If you have a "no server suitable for synchronization found", your hosting provider may be blocking ntp packets. Refer to [this](http://askubuntu.com/questions/429306/ntpdate-no-server-suitable-for-synchronization-found) community question for more information
Loading