Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Tested dependencies #110

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f693ffa
Deleted .vscode and stopped its tracking
RK22000 Mar 23, 2024
7230ffd
Merge pull request #100 from SJSURoboticsTeam/delete.vscode
chrehall68 Mar 23, 2024
2439110
Created a env_files dir to hold env files for all platforms
RK22000 Mar 23, 2024
6676152
Implemented and tested bridge-gps
RK22000 Mar 23, 2024
e0c05b2
Merged dev into this to prepare this to merge into dev without conflicts
RK22000 Mar 23, 2024
9f9aa3f
updated a rover requirement
RK22000 Mar 23, 2024
5e615a0
Merge pull request #101 from SJSURoboticsTeam/env_files
chrehall68 Mar 23, 2024
7523731
Created a sphinx Documentation site that can auto load documentation …
RK22000 Mar 24, 2024
bd102ff
Added a sphinx build workflow script
RK22000 Mar 24, 2024
a39e29f
Added a requirement to the theme
RK22000 Mar 24, 2024
c9d94f1
added explicit dependency to docutils to fetch the latest version
RK22000 Mar 24, 2024
b59a08d
Specified docutils version
RK22000 Mar 24, 2024
b8f26b7
Trying to deploy from _build instead of build
RK22000 Mar 24, 2024
6382749
Merge branch 'main' into dev
chrehall68 Mar 24, 2024
f7a1dff
Set build dirs in workflow
RK22000 Mar 24, 2024
85961db
Switched to deploying from main
RK22000 Mar 24, 2024
74d958e
Wrote some doc string for a_star_navigator
RK22000 Mar 24, 2024
fef4f2b
Added dependencies
RK22000 Mar 24, 2024
b864c20
Removed pyqt6 dep
RK22000 Mar 24, 2024
71c79b0
Removed RPi dep
RK22000 Mar 24, 2024
3668a34
Removed sambus dep
RK22000 Mar 24, 2024
82bbd43
Back to min requirements
RK22000 Mar 24, 2024
fe0934c
Added a few dependencies that i think wont break
RK22000 Mar 24, 2024
8e2463b
Rendering sphinx from dev
RK22000 Mar 24, 2024
e74b624
Merge pull request #104 from SJSURoboticsTeam/sphinx_docs
chrehall68 Mar 24, 2024
e1d3f15
Anything ending in 'env' in the proj root will be ignored
RK22000 Mar 27, 2024
61cd067
match files whose file extension ends in .*env
chrehall68 Mar 30, 2024
e2ca7c3
Merge pull request #105 from SJSURoboticsTeam/GitIgnoreUpdate
chrehall68 Mar 30, 2024
77082dc
Merged and resolved a conflict to merge into dev
RK22000 Mar 30, 2024
27b43bf
Merge pull request #102 from SJSURoboticsTeam/bridge-gps
chrehall68 Mar 30, 2024
4d589fa
merge requirements.txt into the env files
chrehall68 Mar 30, 2024
6d60e9e
update readme to reflect dual dependency files
chrehall68 Mar 30, 2024
d5b3da5
remove unnecessary modules, test dependencies on pi
chrehall68 Mar 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Sphinx: Render docs"

on: push

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Build HTML
uses: ammaraskar/sphinx-action@master
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: html-docs
path: docs/_build/html/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/dev'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ __pycache__/

.python-version

.env
.venv
env/
venv/
*env
*.*env
ENV/
env.bak/
venv.bak/

**.freq
frequency_analysis.json
**_build
6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

7 changes: 5 additions & 2 deletions CommandScripts/AutoHelp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import math
#from modules.LSM303 import Compass
from modules.LSM303 import Compass
from proj_modules.LSM303 import Compass
import json

class AutoHelp:
Expand Down Expand Up @@ -75,12 +75,15 @@ def jsonify_commands(self, commands):


def get_bearing(self, current_GPS, target_GPS):
"""Returns the angle between two GPS coordinates
"""
Returns the angle between two GPS coordinates

PARAMS:
current_GPS (tuple): (latitude, longitude)
target_GPS (tuple): (latitude, longitude)
RETURNS:
float. angle between the two coordinates

"""
try:
current_latitude = math.radians(current_GPS[1])
Expand Down
3 changes: 2 additions & 1 deletion CommandScripts/GPS_NAV.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os, sys

sys.path.insert(0, os.path.abspath(".."))
from modules.LSM303 import Compass
from proj_modules.LSM303 import Compass
from CommandScripts import AutoHelp
from simple_pid import PID
import time
Expand All @@ -19,6 +19,7 @@ def get_target_angle(
self, lidar_data, rover_angle, current_longlat, target_longlat
):
"""Obstacle avoidance logic that uses vector field histogram (VFH)

PARAMS:
lidar_data (list): array of 360 elements. each index is an angle
rover_angle (int): the angle that the rover is currently facing
Expand Down
25 changes: 0 additions & 25 deletions CommandScripts/MMT-drive-command.py

This file was deleted.

26 changes: 26 additions & 0 deletions CommandScripts/MMT_drive_command.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sys
import requests
import serial.tools.list_ports as port_list
import os, sys
sys.path.insert(0, os.path.abspath(".."))
from proj_modules.Serial import SerialSystem

if __name__=='__main__':
port = "/dev/ttyUSB0"
get_initial_commands_url = "http://192.168.1.133:5000/drive"

web_response = requests.get(get_initial_commands_url)
print("Getting data from: " + web_response.text)

try:
serial = SerialSystem(port, 38400)
print("Using port: " + port)
except:
ports = list(port_list.comports())
print('====> Designated Port not found. Using Port:', ports[0].device)
port = ports[0].device
serial = SerialSystem(port, 38400)

while True:
web_response = requests.get(get_initial_commands_url)
serial.read_write_serial(web_response.text)
4 changes: 2 additions & 2 deletions CommandScripts/autonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
sys.path.insert(0, os.path.abspath(".."))
from CommandScripts.GPS_NAV import GPS_Nav
from CommandScripts import AutoHelp
from modules.LSM303 import Compass
from modules.WiFi import WiFi
from proj_modules.LSM303 import Compass
from proj_modules.WiFi import WiFi
import time
import threading

Expand Down
30 changes: 0 additions & 30 deletions CommandScripts/drive-command.py

This file was deleted.

31 changes: 31 additions & 0 deletions CommandScripts/drive_command.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import sys
import requests
import serial.tools.list_ports as port_list
import os, sys
sys.path.insert(0, os.path.abspath(".."))
from proj_modules.Serial import SerialSystem

if __name__=='__main__':
port = "/dev/ttyUSB0"
get_initial_commands_url = "http://192.168.50.243:5000/drive"

web_response = requests.get(get_initial_commands_url)
print("Getting data from: " + web_response.text)

try:
serial = SerialSystem(port, 38400)
print("Using port: " + port)
except:
ports = list(port_list.comports())
print('====> Designated Port not found. Using Port:', ports[0].device)
port = ports[0].device
serial = SerialSystem(port, 38400)

homing_end = "Starting control loop..."
while True:
response = serial.read_serial()
if homing_end in response:
while True:
web_response = requests.get(get_initial_commands_url)
serial.read_write_serial(web_response.text)

85 changes: 43 additions & 42 deletions Missions/MMT_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
sys.path.insert(0, os.path.abspath(".."))
import requests
import serial.tools.list_ports as port_list
from modules.Serial import SerialSystem
from proj_modules.Serial import SerialSystem
from CommandScripts.autonomy import Autonomy
from modules.old_GPS import gpsRead
from proj_modules.old_GPS import gpsRead
import json

serial_port = "/dev/ttyACM2"
Expand All @@ -16,51 +16,52 @@
server = 'http://13.56.207.97:5000'
GPS_list = []

try:
serial = SerialSystem(serial_port, serial_baudrate)
print("Using port: " + serial_port, "For Serial Comms")
except:
ports = list(port_list.comports())
print('====> Designated Port not found. Using Port:', ports[0].device, "For Serial Connection")
serial_port = ports[0].device
serial = SerialSystem(serial_port, serial_baudrate)
if __name__=='__main__':
try:
serial = SerialSystem(serial_port, serial_baudrate)
print("Using port: " + serial_port, "For Serial Comms")
except:
ports = list(port_list.comports())
print('====> Designated Port not found. Using Port:', ports[0].device, "For Serial Connection")
serial_port = ports[0].device
serial = SerialSystem(serial_port, serial_baudrate)


try:
GPS = gpsRead(gps_port,gps_baudrate)
print("Using port: " + gps_port, "For GPS")
except:
port_number = 0
ports = list(port_list.comports())
print('====> Designated Port not found. Using Port:', ports[port_number].device, "For GPS Connection")
port = ports[port_number].device
GPS = gpsRead(port,gps_baudrate)
while GPS.get_position() == ['error', 'error'] or GPS.get_position() == ["None", "None"]:
print("Port not found, going to next port...")
port_number += 1
gps_port = ports[port_number].device
try:
GPS = gpsRead(port,gps_baudrate)
except:
continue
break
try:
GPS = gpsRead(gps_port,gps_baudrate)
print("Using port: " + gps_port, "For GPS")
except:
port_number = 0
ports = list(port_list.comports())
print('====> Designated Port not found. Using Port:', ports[port_number].device, "For GPS Connection")
port = ports[port_number].device
GPS = gpsRead(port,gps_baudrate)
while GPS.get_position() == ['error', 'error'] or GPS.get_position() == ["None", "None"]:
print("Port not found, going to next port...")
port_number += 1
gps_port = ports[port_number].device
try:
GPS = gpsRead(port,gps_baudrate)
except:
continue
break


GPS_map_url = f"{server}/gps"
try:
GPS_map = requests.get(GPS_map_url)
except:
print("Could not get GPS map from mission control")
exit(1)
GPS_map_url = f"{server}/gps"
try:
GPS_map = requests.get(GPS_map_url)
except:
print("Could not get GPS map from mission control")
exit(1)

GPS_map = json.loads(GPS_map.text)
GPS_map = json.loads(GPS_map.text)

for i in GPS_map:
GPS_list.append(GPS_map[i])
print("GPS List:", GPS_list)
for i in GPS_map:
GPS_list.append(GPS_map[i])
print("GPS List:", GPS_list)

GPS_list = [[-121.8818685, 37.33699716666666], [-121.881868, 37.33696233333334], [-121.88177050000002, 37.336928833333324]]
print("GPS List:", GPS_list)
GPS_list = [[-121.8818685, 37.33699716666666], [-121.881868, 37.33696233333334], [-121.88177050000002, 37.336928833333324]]
print("GPS List:", GPS_list)

rover = Autonomy(serial, server, max_speed, max_angle, GPS, GPS_list)
rover.start_mission()
rover = Autonomy(serial, server, max_speed, max_angle, GPS, GPS_list)
rover.start_mission()
File renamed without changes.
Loading