First, if submodules were not recursevly added through git. Run this command if you have made any attempt to make vrpn manually.
run
```bash
'git submodule update --init --recursive'
git submodule update --init--recursive
```
Now that you have all of the files necissary.
cd into the groundstation folder.
```bash
cd groundStation
make vrpn
make
```
run the program with sudo privledges
run the program with privledges
```bash
./BackEnd
```
If you wish to change the way the backend communicates to the quad and vice versa, look at src/config.h.
This provides a list of environment variables which you can set and use for your computer or time of use.
## Changing Defaults
If you wish to change the way the backend communicates to the quad and vice versa, look at `src/config.h`.
This provides a list of environment variables which you can set and use for your computer or time of use.
## Modifying
See MODIFYING for the software architecture/organization and how to add new functionality.
## Using
First, the backend daemon must be running. Run the backend with ./BackEnd. Note
the environment variables in config.h, especially the backend socket path. The backend
requires root for bluetooth, but can run as a normal user with TCP, as long as the
First, the backend daemon must be running. Run the backend with
```bash
./BackEnd
```
**Note:** The backend requires root for bluetooth, but can run as a normal user with TCP, as long as the
socket path is writable by the user.
Once the backend is running, various CLI tools can be used to view the state of the
quad and send commands. Each of these tools is given as the first argument
to the CLI program, for example, to get a node output the quad, use `cli getoutput`. Note that
to the CLI program, for example, to get a node output from the quad, use `cli getoutput`. Note that
the backend socket environment variable must be set to the same value as it
was for the backend. The CLI program also supports busybox-style symbolic links.
For example, if there is a symlink named `getoutput` that points to the `cli` binary,
...
...
@@ -41,48 +44,41 @@ running the `getoutput` program will effectively run `cli getoutput`.
The names of the binaries is subject to change.
For a list of cli commands and more in depth usage explainations, use the --help flag.
'./Cli --help'
For a list of cli commands and more in depth usage explainations, use the `--help` flag.
```bash
./Cli --help
```
For help with the specific cli command you are running, use the --help flag once again.
'./Cli getoutput --help'
For help with the specific cli command you are running, use the `--help` flag once again.
```bash
./Cli getoutput --help
```
### Example
In one terminal or screen, run the backend:
`./BackEnd`
```bash
./BackEnd
```
This will activate the quad and the backend, and the backend will be available for
connections from the frontend tools. One useful tool is the getnodes. In another
connections from the frontend tools. One useful tool is the `getnodes`. In another
terminal window, run
`./Cli getnodes`
```bash
./Cli getnodes
```
or alternatively with symlinks
`./getnodes`
This will fetch the block_id, type_id and name of every node in the current graph
You can run any number of any combination of frontend tools at the same time.
### Batch Update of PID constants
The CLI only supports setting one PID constant at a time using the following command.
From the `groundStation` folder:
```
./Cli setpid --pitch -p 1.000
```bash
./getnodes
```
This can get tedious for 27 PID constants.
To help, we made a batch script that allows you to easily set all 27 PID constants at once and save your progress as you go.
This will fetch the `block_id`, `type_id` and name of every node in the current graph
First, edit the `parameters.txt` file in the `groundStation/scripts` folder to specify the values you want to set. The script will parse this file and pass them to the `Cli` program.
Then simply run the script from the `groundStation` folder:
```
scripts/setpid_batch.sh
```
You can run any number of any combination of frontend tools at the same time.
If you find it helpful, with this setup you can create a bash script that simply
runs the same commands. This has been found to be of use when we are tuning.
Remember to commit your changes in the `parameters.txt` file if you believe you have found a better default state for the quad.
\ No newline at end of file
There are a couple of already written bash scripts in the `scripts/` folder.