-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: address pylint warnings
- Loading branch information
Showing
18 changed files
with
581 additions
and
594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.pyc | ||
.venv | ||
__pycache__ | ||
.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Requirement already satisfied: mypy==1.8.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (1.8.0) | ||
Requirement already satisfied: pylint==3.2.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (3.2.5) | ||
Requirement already satisfied: ruff==0.1.14 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (0.1.14) | ||
Requirement already satisfied: pylint-protobuf==0.22.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (0.22.0) | ||
Requirement already satisfied: remotivelabs-broker in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (0.1.26) | ||
Requirement already satisfied: pytest in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (8.2.2) | ||
Requirement already satisfied: tomli>=1.1.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from mypy==1.8.0) (2.0.1) | ||
Requirement already satisfied: typing-extensions>=4.1.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from mypy==1.8.0) (4.12.2) | ||
Requirement already satisfied: mypy-extensions>=1.0.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from mypy==1.8.0) (1.0.0) | ||
Requirement already satisfied: dill>=0.2 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (0.3.8) | ||
Requirement already satisfied: astroid<=3.3.0-dev0,>=3.2.2 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (3.2.2) | ||
Requirement already satisfied: platformdirs>=2.2.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (4.2.2) | ||
Requirement already satisfied: mccabe<0.8,>=0.6 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (0.7.0) | ||
Requirement already satisfied: isort!=5.13.0,<6,>=4.2.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (5.13.2) | ||
Requirement already satisfied: tomlkit>=0.10.1 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (0.12.5) | ||
Requirement already satisfied: protobuf in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint-protobuf==0.22.0) (5.27.2) | ||
Requirement already satisfied: requests~=2.21 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (2.32.3) | ||
Requirement already satisfied: grpc-stubs~=1.53.0.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (1.53.0.5) | ||
Collecting protobuf | ||
Using cached protobuf-3.20.1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB) | ||
Requirement already satisfied: grpcio~=1.44 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (1.64.1) | ||
Requirement already satisfied: types-protobuf~=4.24.0.20240106 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (4.24.0.20240408) | ||
Requirement already satisfied: grpc-interceptor~=0.14 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (0.15.4) | ||
Requirement already satisfied: mypy-protobuf~=3.3.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (3.3.0) | ||
Requirement already satisfied: iniconfig in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pytest) (2.0.0) | ||
Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pytest) (1.2.1) | ||
Requirement already satisfied: pluggy<2.0,>=1.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pytest) (1.5.0) | ||
Requirement already satisfied: packaging in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pytest) (24.1) | ||
Requirement already satisfied: certifi>=2017.4.17 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from requests~=2.21->remotivelabs-broker) (2024.6.2) | ||
Requirement already satisfied: idna<4,>=2.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from requests~=2.21->remotivelabs-broker) (3.7) | ||
Requirement already satisfied: urllib3<3,>=1.21.1 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from requests~=2.21->remotivelabs-broker) (2.2.2) | ||
Requirement already satisfied: charset-normalizer<4,>=2 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from requests~=2.21->remotivelabs-broker) (3.3.2) | ||
Installing collected packages: protobuf | ||
Attempting uninstall: protobuf | ||
Found existing installation: protobuf 5.27.2 | ||
Uninstalling protobuf-5.27.2: | ||
Successfully uninstalled protobuf-5.27.2 | ||
Successfully installed protobuf-3.20.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import signal as signals | ||
import sys | ||
import threading | ||
from argparse import Namespace | ||
from typing import Any | ||
|
||
from lib import arguments | ||
from lib.broker import Broker | ||
|
||
# Simple program designed to be used with our cloud demo. | ||
# It is expected that you have followed the steps at | ||
# https://demo.remotivelabs.com and started a broker + uploaded | ||
# a recording. | ||
|
||
# Once you complete the stages in our cloud-demo you will get all | ||
# information required to run this program. It will look something like: | ||
|
||
# python3 cloud_demo.py \ | ||
# --url <broker_url> \ | ||
# --api-key <api_key> \ | ||
# --signals VehicleSpeed,ChassisAcceleratorPedalposition | ||
|
||
expected_available_signals = [ | ||
"VehicleSpeed", | ||
"ChassisSteeringwheelAngle", | ||
"ChassisAcceleratorPedalposition", | ||
"VehicleCurrentlocationLongitude", | ||
"VehicleCurrentlocationLatitude", | ||
] | ||
|
||
|
||
def print_signals(frame: Any) -> None: | ||
for s in frame: | ||
print(s) | ||
|
||
|
||
def main(argv: Namespace) -> None: | ||
print(f"Connecting to {argv.url}") | ||
|
||
broker = Broker(argv.url, argv.api_key, argv.access_token) | ||
|
||
print("Listing available signals") | ||
available_signals = broker.list_signal_names() | ||
for signal in available_signals: | ||
print(f" - {signal}") | ||
|
||
# Sanity check so we are running against the expected recording | ||
if available_signals != expected_available_signals: | ||
print( | ||
"It does not look like you have started the demo recording in cloud. \n" | ||
"Make sure you play turning-torso-drivecycle.zip on this broker from " | ||
"https://demo.remotivelabs.com/p/demo/brokers" | ||
) | ||
sys.exit(0) | ||
|
||
# Start subscribe to selected signals | ||
subscription = broker.subscribe(signals=argv.signals, on_frame=print_signals, changed_values_only=True) | ||
|
||
# play demo recording | ||
broker.play(namespace="custom_can", path="turning-torso-drivecycle.zip") | ||
|
||
# Wait 20 seconds and then shutdown. | ||
# Remove the lines below to just have it running | ||
sleep(seconds=20) | ||
|
||
print("Cancelling subscription (20 secs or ctr-c, you can change this to just keep it running)") | ||
subscription.cancel() | ||
|
||
|
||
def sleep(seconds: float) -> None: | ||
lock = threading.Event() | ||
signals.signal(signals.SIGINT, lambda signum, frame: lock.set()) | ||
lock.wait(timeout=seconds) | ||
|
||
|
||
if __name__ == "__main__": | ||
args = arguments.parse() | ||
main(args) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.