Skip to content

Commit

Permalink
fix: formatting and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto-abarzua committed Nov 6, 2023
1 parent 55fdac1 commit ed0962c
Show file tree
Hide file tree
Showing 32 changed files with 7,201 additions and 7,215 deletions.
1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.pdm-python
1 change: 0 additions & 1 deletion backend/.pdm-python

This file was deleted.

3 changes: 2 additions & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM python:3.11.6-alpine
FROM python:3.11-slim-buster

WORKDIR /app

RUN apt-get update && apt-get install -y build-essential

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
7 changes: 3 additions & 4 deletions backend/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
dependencies = [
"fastapi>=0.101.1",
"uvicorn>=0.23.2",
"numpy>=1.25.2",
"numpy>=1.20",
]
requires-python = ">=3.11"
readme = "README.md"
Expand Down
8 changes: 7 additions & 1 deletion backend/src/routers/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ def move(move: Move, controller: ArmController = controller_dependency) -> JSONR
else:
return JSONResponse(content={"message": "Not moved"}, status_code=400)


@router.post("/pose/relative/")
def move_relative(move: Move, controller: ArmController = controller_dependency) -> JSONResponse:
def move_relative(
move: Move, controller: ArmController = controller_dependency
) -> JSONResponse:
move_dict = move.model_dump()
wait = move_dict.pop("wait")

Expand All @@ -104,6 +107,7 @@ def move_relative(move: Move, controller: ArmController = controller_dependency)
else:
return JSONResponse(content={"message": "Not moved"}, status_code=400)


@router.post("/pose/validate/")
def valid_pose(
move: Move, controller: ArmController = controller_dependency
Expand All @@ -117,10 +121,12 @@ def valid_pose(
else:
return JSONResponse(content={"message": "Pose is not valid"}, status_code=400)


# --------
# Joints
# --------


@router.post("/joint/")
def move_joint(
move: MoveJoint, controller: ArmController = controller_dependency
Expand Down
4 changes: 2 additions & 2 deletions controller/src/robot_arm_controller/control/arm_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def as_dict(self) -> Dict[str, float]:
"yaw": self.yaw,
}

def __add__(self, other: 'ArmPose') -> 'ArmPose':
def __add__(self, other: "ArmPose") -> "ArmPose":
if not isinstance(other, ArmPose):
raise ValueError("Can only add two ArmPose instances")
return ArmPose(
Expand All @@ -158,7 +158,7 @@ def __add__(self, other: 'ArmPose') -> 'ArmPose':
self.z + other.z,
self.roll + other.roll,
self.pitch + other.pitch,
self.yaw + other.yaw
self.yaw + other.yaw,
)


Expand Down
8 changes: 3 additions & 5 deletions controller/src/robot_arm_controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,11 @@ def move_to(
return self.move_joints_to(target_angles)

def move_to_relative(
self,
pose: ArmPose,
self,
pose: ArmPose,
) -> bool:
target_pose = self.current_pose + pose
return self.move_to(target_pose)


def home(self, wait: bool = True) -> None:
if self.print_status:
Expand Down Expand Up @@ -523,8 +522,7 @@ def create_instance(
cls.print_status = print_status
cls.config_file = config_file

cls._instance = ArmController(arm_parameters=arm_parameters,
websocket_port=websocket_port, server_port=server_port)
cls._instance = ArmController(arm_parameters=arm_parameters, websocket_port=websocket_port, server_port=server_port)
cls._instance.print_status = print_status
if config_file is not None:
cls._instance.set_config_file(config_file)
Expand Down
1 change: 0 additions & 1 deletion frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": [
"eslint:recommended",
"plugin:@next/next/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended"
Expand Down
30 changes: 15 additions & 15 deletions frontend/components.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": false,
"tailwind": {
"config": "tailwind.config.js",
"css": "@/src/index.css",
"baseColor": "slate",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": false,
"tailwind": {
"config": "tailwind.config.js",
"css": "@/src/index.css",
"baseColor": "slate",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
Loading

0 comments on commit ed0962c

Please sign in to comment.