<commit_before>#!/bin/bash
file=/boot/DroneBridgeTX.ini
mode=$(awk -F "=" '/^mode/ {gsub(/[ \t]/, "", $2); print $2}' $file)
comm_id=$(awk -F "=" '/^communication_id/ {gsub(/[ \t]/, "", $2); print $2}' $file)
interface_selection=$(awk -F "=" '/^interface_selection/ {gsub(/[ \t]/, "", $2); print $2}' $file)

interface_control=$(awk -F "=" '/^interface_control/ {gsub(/[ \t]/, "", $2); print $2}' $file)
interface_tel=$(awk -F "=" '/^interface_tel/ {gsub(/[ \t]/, "", $2); print $2}' $file)
interface_video=$(awk -F "=" '/^interface_video/ {gsub(/[ \t]/, "", $2); print $2}' $file)
interface_comm=$(awk -F "=" '/^interface_comm/ {gsub(/[ \t]/, "", $2); print $2}' $file)

port_drone=$(awk -F "=" '/^port_drone/ {gsub(/[ \t]/, "", $2); print $2}' $file)
port_smartphone_ltm=$(awk -F "=" '/^port_smartphone_ltm/ {gsub(/[ \t]/, "", $2); print $2}' $file)
port_local_smartphone=$(awk -F "=" '/^port_local_smartphone/ {gsub(/[ \t]/, "", $2); print $2}' $file)
ip_drone=$(awk -F "=" '/^ip_drone/ {gsub(/[ \t]/, "", $2); print $2}' $file)
mac_drone=$(awk -F "=" '/^mac_drone/ {gsub(/[ \t]/, "", $2); print $2}' $file)
joy_interface=$(awk -F "=" '/^joy_interface/ {gsub(/[ \t]/, "", $2); print $2}' $file)
joy_cal=$(sed -n -e 's/^\s*joy_cal\s*=\s*//p' $file)

if [[ interface_selection=='auto' ]]; then
	NICS=`ls /sys/class/net/ | nice grep -v eth0 | nice grep -v lo | nice grep -v usb | nice grep -v intwifi | nice grep -v relay | nice grep -v wifihotspot`
    echo -n "NICS:"
    echo $NICS
    for NIC in $NICS 
	do
		interface_control=$NIC
		interface_tel=$NIC
		interface_video=$NIC
		interface_comm=$NIC
	done
fi

# 1 = Ralink | 2 = Atheros
frametype_video=1
frametype_control=1
frametype_tel=1
frametype_comm=1
DRIVER=`cat /sys/class/net/$interface_control/device/uevent | nice grep DRIVER | sed 's/DRIVER=//'`
if [ "$DRIVER" == "ath9k_htc" ]; then
    frametype_control=2
fi
DRIVER=`cat /sys/class/net/$interface_tel/device/uevent | nice grep DRIVER | sed 's/DRIVER=//'`
if [ "$DRIVER" == "ath9k_htc" ]; then
    frametype_tel=2
fi
DRIVER=`cat /sys/class/net/$interface_video/device/uevent | nice grep DRIVER | sed 's/DRIVER=//'`
if [ "$DRIVER" == "ath9k_htc" ]; then
    frametype_video=2
fi
DRIVER=`cat /sys/class/net/$interface_comm/device/uevent | nice grep DRIVER | sed 's/DRIVER=//'`
if [ "$DRIVER" == "ath9k_htc" ]; then
    frametype_comm=2
fi

echo "DroneBridge-TX: Communication ID: $comm_id"
echo "DroneBridge-TX: Interfaces: Control: $interface_control Telemetry: $interface_tel Video: $interface_video Communication: $interface_comm - Joystick Interface: $joy_interface - Mode: $mode"
echo "DroneBridge-TX: Frametypes: Control: $frametype_control Telemetry: $frametype_tel Video: $frametype_video Communication: $frametype_comm"
echo "DroneBridge-TX: calibrating RC using: '$joy_cal'"

echo "DroneBridge-TX: Trying to start individual modules..."

echo "DroneBridge-TX: Starting communication module..."
python3 comm_telemetry/db_comm_tx.py -i $interface_comm -p $port_drone -r $ip_drone -u $port_local_smartphone -m $mode -a $frametype_comm -c $comm_id &

echo "DroneBridge-TX: Starting telemetry module..."
python3 comm_telemetry/db_telemetry_tx.py -i $interface_tel -r $ip_drone -p $port_drone -m $mode -a $frametype_tel -c $comm_id &

#./home/pi/airbridge/video/Project_Pegasus_video_tx &

echo "DroneBridge-TX: Starting controller module...\n"
./control/ground/control_tx -n $interface_control -j $joy_interface -d $mac_drone -m $mode -c "$joy_cal" &
<commit_msg>command line parameter change: calibration joystick<commit_after>#!/bin/bash
file=/boot/DroneBridgeTX.ini
mode=$(awk -F "=" '/^mode/ {gsub(/[ \t]/, "", $2); print $2}' $file)
comm_id=$(awk -F "=" '/^communication_id/ {gsub(/[ \t]/, "", $2); print $2}' $file)
interface_selection=$(awk -F "=" '/^interface_selection/ {gsub(/[ \t]/, "", $2); print $2}' $file)

interface_control=$(awk -F "=" '/^interface_control/ {gsub(/[ \t]/, "", $2); print $2}' $file)
interface_tel=$(awk -F "=" '/^interface_tel/ {gsub(/[ \t]/, "", $2); print $2}' $file)
interface_video=$(awk -F "=" '/^interface_video/ {gsub(/[ \t]/, "", $2); print $2}' $file)
interface_comm=$(awk -F "=" '/^interface_comm/ {gsub(/[ \t]/, "", $2); print $2}' $file)

port_drone=$(awk -F "=" '/^port_drone/ {gsub(/[ \t]/, "", $2); print $2}' $file)
port_smartphone_ltm=$(awk -F "=" '/^port_smartphone_ltm/ {gsub(/[ \t]/, "", $2); print $2}' $file)
port_local_smartphone=$(awk -F "=" '/^port_local_smartphone/ {gsub(/[ \t]/, "", $2); print $2}' $file)
ip_drone=$(awk -F "=" '/^ip_drone/ {gsub(/[ \t]/, "", $2); print $2}' $file)
mac_drone=$(awk -F "=" '/^mac_drone/ {gsub(/[ \t]/, "", $2); print $2}' $file)
joy_interface=$(awk -F "=" '/^joy_interface/ {gsub(/[ \t]/, "", $2); print $2}' $file)
joy_cal=$(sed -n -e 's/^\s*joy_cal\s*=\s*//p' $file)

if [[ interface_selection=='auto' ]]; then
	NICS=`ls /sys/class/net/ | nice grep -v eth0 | nice grep -v lo | nice grep -v usb | nice grep -v intwifi | nice grep -v relay | nice grep -v wifihotspot`
    echo -n "NICS:"
    echo $NICS
    for NIC in $NICS 
	do
		interface_control=$NIC
		interface_tel=$NIC
		interface_video=$NIC
		interface_comm=$NIC
	done
fi

# 1 = Ralink | 2 = Atheros
frametype_video=1
frametype_control=1
frametype_tel=1
frametype_comm=1
DRIVER=`cat /sys/class/net/$interface_control/device/uevent | nice grep DRIVER | sed 's/DRIVER=//'`
if [ "$DRIVER" == "ath9k_htc" ]; then
    frametype_control=2
fi
DRIVER=`cat /sys/class/net/$interface_tel/device/uevent | nice grep DRIVER | sed 's/DRIVER=//'`
if [ "$DRIVER" == "ath9k_htc" ]; then
    frametype_tel=2
fi
DRIVER=`cat /sys/class/net/$interface_video/device/uevent | nice grep DRIVER | sed 's/DRIVER=//'`
if [ "$DRIVER" == "ath9k_htc" ]; then
    frametype_video=2
fi
DRIVER=`cat /sys/class/net/$interface_comm/device/uevent | nice grep DRIVER | sed 's/DRIVER=//'`
if [ "$DRIVER" == "ath9k_htc" ]; then
    frametype_comm=2
fi

echo "DroneBridge-TX: Communication ID: $comm_id"
echo "DroneBridge-TX: Interfaces: Control: $interface_control Telemetry: $interface_tel Video: $interface_video Communication: $interface_comm - Joystick Interface: $joy_interface - Mode: $mode"
echo "DroneBridge-TX: Frametypes: Control: $frametype_control Telemetry: $frametype_tel Video: $frametype_video Communication: $frametype_comm"
echo "DroneBridge-TX: calibrating RC using: '$joy_cal'"

echo "DroneBridge-TX: Trying to start individual modules..."

echo "DroneBridge-TX: Starting communication module..."
python3 comm_telemetry/db_comm_tx.py -i $interface_comm -p $port_drone -r $ip_drone -u $port_local_smartphone -m $mode -a $frametype_comm -c $comm_id &

echo "DroneBridge-TX: Starting telemetry module..."
python3 comm_telemetry/db_telemetry_tx.py -i $interface_tel -r $ip_drone -p $port_drone -m $mode -a $frametype_tel -c $comm_id &

#./home/pi/airbridge/video/Project_Pegasus_video_tx &

echo "DroneBridge-TX: Starting controller module...\n"
./control/ground/control_tx -n $interface_control -j $joy_interface -d $mac_drone -m $mode -g "$joy_cal" &

{'fraction_non_alphanumeric': 0.20557142857142857, 'fraction_numerical': 0.012285714285714285, 'mean_word_length': 4.4609984399375975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3896660', 'n_tokens_mistral': 2870, 'n_tokens_neox': 2727, 'n_words': 667}