Skip to content
Snippets Groups Projects
Commit 5f65df69 authored by bbartels's avatar bbartels
Browse files

groundStation: Add script for batch setting of PID constants

parent 97c96676
No related branches found
No related tags found
1 merge request!4Batch setpid
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
lat p 1.0
lat i 1.0
lat d 1.0
long p 1.0
long i 1.0
long d 1.0
height p 1.0
height i 1.0
height d 1.0
pitch p 1.0
pitch i 1.0
pitch d 1.0
roll p 1.0
roll i 1.0
roll d 1.0
yaw p 1.0
yaw i 1.0
yaw d 1.0
pitchv p 1.0
pitchv i 1.0
pitchv d 1.0
rollv p 1.0
rollv i 1.0
rollv d 1.0
yawv p 1.0
yawv i 1.0
yawv d 1.0
#!/bin/bash
# Use default filename if it wasn't given at the command line
if [ $# -eq 0 ]; then
filename="parameters.txt"
else
filename=$1
fi
# Define the regular expression used for grep to define accepted line
regex='(lat|long|height|pitch|roll|yaw|pitchv|rollv|yawv) (p|i|d) ([-+]?[0-9]*\.?[0-9]+)'
# the awk program to assemble the correct pieces of the string for a ./Cli call
awk_prog='{print "./Cli setpid" " " "--" $1 " " "-" $2 " " $3}'
# Search, parse, and execute ./Cli commands
grep -E "$regex" $filename | awk "$awk_prog" | bash
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment