Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into document-online-bagger
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrxyz committed Feb 28, 2024
2 parents b706724 + 4474cf7 commit 914ebb9
Show file tree
Hide file tree
Showing 134 changed files with 1,456 additions and 491 deletions.
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/navigator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,6 @@ body:
attributes:
value: |
Hey, thanks for taking the time to add this software issue!
- type: input
id: assignee
attributes:
label: Assignee
description: >
Does this issue need to be completed by a specific person on the team?
If so, mention them below.
placeholder: ex. @torvalds is already working on this task!
validations:
required: false
- type: input
id: deadline
attributes:
label: Deadline
description: >
Does this task need a deadline? _If this task is related to a competition,
it should have a deadline._
placeholder: ex. 2023-12-25
validations:
required: false
- type: textarea
id: description
attributes:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,20 @@ jobs:
- name: Configure catkin workspace folder structure
run: |
mkdir -p $GITHUB_WORKSPACE/catkin_ws/src
sudo apt reinstall python3-pip
- name: Check out code from GitHub
uses: actions/[email protected]
with:
submodules: recursive
path: catkin_ws/src/mil
- name: Setup ROS Noetic
uses: ros-tooling/setup-ros@v0.3
uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: noetic
- name: Install pip dependencies
run: |
cd $GITHUB_WORKSPACE/catkin_ws/src/mil
pip install -r requirements.txt
pip3 install -r requirements.txt
# We want to run a full test suite in CI - this includes the BlueView
# tests!
- name: Install BlueView Sonar SDK
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

# Wait for the CI to finish so we can download the docs artifact
- name: Wait for CI
uses: lewagon/wait-on-check-action@v1.0.0
uses: lewagon/wait-on-check-action@v1.3.3
if: github.event.action != 'closed'
with:
ref: ${{ github.event.pull_request.head.ref }}
Expand Down
21 changes: 11 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,41 @@ ci:

repos:
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
rev: v1.33.0
hooks:
- id: yamllint
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.4
rev: v17.0.6
hooks:
- id: clang-format
- repo: https://github.com/PyCQA/autoflake
rev: v2.1.1
rev: v2.2.1
hooks:
- id: autoflake
args: [--remove-all-unused-imports, --ignore-init-module-imports]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
rev: v0.9.0.6
hooks:
- id: shellcheck
exclude: ^docker|deprecated|NaviGator/simulation/VRX
args: [--severity=warning, --exclude=SC1090]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.6.0-2
rev: v3.7.0-4
hooks:
- id: shfmt
exclude: ^docker|deprecated|NaviGator/simulation/VRX
- repo: https://github.com/charliermarsh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.270'
rev: 'v0.2.0'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.6
hooks:
- id: codespell
args:
Expand Down Expand Up @@ -73,11 +73,12 @@ repos:
- id: prettier-package-xml
- id: sort-package-xml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
exclude_types: [markdown, rst]
- id: check-executables-have-shebangs
- id: check-symlinks
- id: check-json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,7 @@ def publish(self, timer_event):
)
print(e)
fprint(
"w: {}, h: {}".format(
global_ogrid.info.width,
global_ogrid.info.height,
),
f"w: {global_ogrid.info.width}, h: {global_ogrid.info.height}",
msg_color="red",
)

Expand Down
2 changes: 1 addition & 1 deletion NaviGator/gnc/navigator_path_planner/nodes/path_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ def reevaluate_plan(self) -> None:
def action_check(self, _: rospy.timer.TimerEvent) -> None:
"""
Manages action preempting. Serves as the callback to a Timer operating
opereating every self.revisit_period seconds.
operating every self.revisit_period seconds.
"""
if self.preempted or not self.move_server.is_active():
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,11 @@ def from_urdf(
if find != -1 and find + len(transmission_suffix) == len(transmission.name):
if len(transmission.joints) != 1:
raise Exception(
"Transmission {} does not have 1 joint".format(
transmission.name,
),
f"Transmission {transmission.name} does not have 1 joint",
)
if len(transmission.actuators) != 1:
raise Exception(
"Transmission {} does not have 1 actuator".format(
transmission.name,
),
f"Transmission {transmission.name} does not have 1 actuator",
)

t_ratio = transmission.actuators[0].mechanicalReduction
Expand All @@ -195,9 +191,7 @@ def from_urdf(
joint = t_joint
if joint is None:
rospy.logerr(
"Transmission joint {} not found".format(
transmission.joints[0].name,
),
f"Transmission joint {transmission.joints[0].name} not found",
)
try:
trans = buff.lookup_transform(
Expand All @@ -217,9 +211,7 @@ def from_urdf(
joints.append(joint.name)
if limit != -1 and joint.limit.effort != limit:
raise Exception(
"Thruster {} had a different limit, cannot proceed".format(
joint.name,
),
f"Thruster {joint.name} had a different limit, cannot proceed",
)
limit = joint.limit.effort
limit_tuple = (limit, -limit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
The computer can also command a kill (for example, if ROS notices a criticaly low battery)
by sending the COMPUTER.KILL.REQUEST and undone with COMPUTER.CLEAR.REQUEST
"""

constants = {
"TIMEOUT_SECONDS": 8.0, # How often board must be pinged to not set HEARTBERAT_REMOTE True
# Note: not official documented, this is just a guess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def _check_voltage(self, msg):
if not self._raised or self._severity != severity:
self.broadcaster.raise_alarm(
severity=severity,
problem_description="battery critcaly low"
if severity == 2
else "battery low",
problem_description=(
"battery critcaly low" if severity == 2 else "battery low"
),
parameters={"voltage": voltage},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,15 @@ def _online_bagger_cb(self, status, result):
rospy.loginfo(f"KILL BAG WRITTEN TO {result.filename}")
else:
rospy.logwarn(
"KILL BAG {}, status: {}".format(
TerminalState.to_string(status),
result.status,
),
f"KILL BAG {TerminalState.to_string(status)}, status: {result.status}",
)

def _kill_task_cb(self, status, result):
if status == 3:
rospy.loginfo("Killed task success!")
return
rospy.logwarn(
"Killed task failed ({}): {}".format(
TerminalState.to_string(status),
result.result,
),
f"Killed task failed ({TerminalState.to_string(status)}): {result.result}",
)

def raised(self, alarm):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ def check_continuity(self, odom):
self._raised = True # Avoid raising multiple times
rospy.logwarn("ODOM DISCONTINUITY DETECTED")
self.ab.raise_alarm(
problem_description="ODOM DISCONTINUITY DETECTED. JUMPED {} METERS".format(
jump,
),
problem_description=f"ODOM DISCONTINUITY DETECTED. JUMPED {jump} METERS",
severity=5,
)
self.last_position = position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ def _check_faults(self, msg, topic):
return
self.broadcaster.raise_alarm(
severity=5,
problem_description="{} thrusters have faults".format(
len(self._raised_alarms),
),
problem_description=f"{len(self._raised_alarms)} thrusters have faults",
parameters={
t: self._get_fault_codes(k) for t, k in self._raised_alarms.items()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<param name="/is_vrx" type="bool" value="True" />

<include file="$(find navigator_launch)/launch/gnc/thruster_mapper.launch"/>
<include file="$(find navigator_launch)/launch/vrx/vrx_classifier.launch" />
<include file="$(find navigator_launch)/launch/vrx/vrx_tf.launch" />
<include file="$(find navigator_launch)/launch/vrx/vrx_localization.launch" />
<include file="$(find navigator_launch)/launch/vrx/vrx_upload_urdf.launch" />
Expand All @@ -30,5 +31,4 @@

<node if="$(arg run_task)" name="run_vrx_task" pkg="mil_missions" type="mission_client"
args="run Vrx" output="screen" />
<include file="$(find navigator_launch)/launch/vrx/vrx_classifier.launch" />
</launch>
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<!-- Silent unnecessary TF warnings about missing joint states or missing transforms (cred: osrf/vrx#340)-->
<rosparam param="silent_tf_failure">true</rosparam>

<node pkg="robot_state_publisher" name="robot_state_publisher" type="robot_state_publisher">
<param name="use_tf_static" value="false" />
</node>
Expand All @@ -11,9 +14,10 @@
</rosparam>
</node>

<!--Publishes connection between wamv/imu_wamv_link and wamv/base_link. Same for wamv/gps_wamv_link.-->
<node pkg="tf2_ros" type="static_transform_publisher" name="imu_base_link_fix" args="0.3 -0.2 1.3 0 0 0 1 wamv/base_link wamv/imu_wamv_link" />
<node pkg="tf2_ros" type="static_transform_publisher" name="gps_base_link_fix" args="-0.85 0 1.3 0 0 1 wamv/base_link wamv/ins_link" />
<node pkg="tf2_ros" type="static_transform_publisher" name="base_link_enu_fix" args="0 0 0 0 0 0 1 enu wamv/base_link" />

<!--Publishes connection between wamv/imu_wamv_link and wamv/base_link. Same for wamv/gps_wamv_link.-->
<node pkg="tf2_ros" type="static_transform_publisher" name="imu_base_link_fix" args="0.3 -0.2 1.3 0 0 0 1 wamv/base_link wamv/imu_wamv_link" />
<node pkg="tf2_ros" type="static_transform_publisher" name="gps_base_link_fix" args="-0.85 0 1.3 0 0 1 wamv/base_link wamv/ins_link" />
<node pkg="tf2_ros" type="static_transform_publisher" name="base_link_enu_fix" args="0 0 0 0 0 0 1 enu wamv/base_link" />

</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ dock_shape_1:
param: /mission/identify_dock/shape_1
options: [CIRCLE, TRIANGLE, CROSS, ANY]
description: >
The shape of the first bay to dock in during the dentify
The shape of the first bay to dock in during the identify
Symbols and Dock mission. If set to ANY, mission should dock based on the
color parameter and set this parameter during the mission
dock_color_1:
param: /mission/identify_dock/color_1
options: [RED, GREEN, BLUE, ANY]
description: >
The color of the first bay to dock in during the dentify Symbols and Dock
The color of the first bay to dock in during the identify Symbols and Dock
mission. If set to ANY, mission should dock based on the shape parameter
and set this parameter during the mission
Expand All @@ -174,7 +174,7 @@ dock_shape_2:
description: >
# yamllint disable-line rule:line-length
The shape of the second bay to dock in during the
dentify Symbols and Dock mission. If set to ANY,
identify Symbols and Dock mission. If set to ANY,
mission should dock based on the color parameter and set this
parameter during the mission
dock_color_2:
Expand All @@ -183,6 +183,6 @@ dock_color_2:
description: >
# yamllint disable-line rule:line-length
The color of the second bay to dock in during the
dentify Symbols and Dock mission.
identify Symbols and Dock mission.
If set to ANY, mission should dock based on the shape
parameter and set this parameter during the mission
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def decode_parameters(cls, parameters):
return parsed

async def run(self, args):
# Publish a velocity of zero for a while to stabalize navigator
# Publish a velocity of zero for a while to stabilize navigator
self.send_feedback("Switching trajectory to constant")
await self.change_trajectory("constant")
await self.nh.sleep(0.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async def run(self, parameters):
_, closest_reds = await self.get_sorted_objects("red_cylinder", 1)
_, closest_greens = await self.get_sorted_objects("green_cylinder", 1)

# Rename the totems for their symantic name
# Rename the totems for their semantic name
green_close = closest_greens[0]
red_close = closest_reds[0]

Expand All @@ -83,7 +83,7 @@ async def run(self, parameters):
_, closest_reds = await self.get_sorted_objects("red_cylinder", 2)
_, closest_greens = await self.get_sorted_objects("green_cylinder", 2)

# Rename the totems for their symantic name
# Rename the totems for their semantic name
green_far = closest_greens[1]
red_far = closest_reds[1]

Expand Down
Loading

0 comments on commit 914ebb9

Please sign in to comment.