Skip to content

Commit

Permalink
Update pre-commit workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauch committed Apr 24, 2024
1 parent d6687ba commit 2961d50
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 71 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ name: pre-commit
on:
pull_request:
jobs:
pre-commits:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9.7
- name: "Install dependencies"
run: |
python -m pip install catkin_lint
- uses: pre-commit/[email protected]
python-version: "3.10"
- uses: actions/cache@v4
with:
extra_args: --all-files --hook-stage manual
path: ~/.cache/pre-commit
key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/[email protected]
26 changes: 3 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
Expand All @@ -12,34 +12,14 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 24.4.0
hooks:
- id: black
args: ["--line-length=100"]
# Cmake hooks
- repo: local
hooks:
- id: ament_lint_cmake
name: ament_lint_cmake
description: Check format of CMakeLists.txt files.
stages: [commit]
entry: ament_lint_cmake
language: system
files: CMakeLists.txt$

# Copyright
- repo: local
hooks:
- id: ament_copyright
name: ament_copyright
description: Check if copyright notice is available in all files.
stages: [commit]
entry: ament_copyright
language: system
# Spellcheck in comments and docs
# skipping of *.svg files is not working...
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
rev: v2.2.6
hooks:
- id: codespell
args: ['--write-changes']
Expand Down
23 changes: 13 additions & 10 deletions my_robot_cell/my_robot_cell_control/launch/rsp.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ def generate_launch_description():
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution([
FindPackageShare("my_robot_cell_control"),
"urdf",
"my_robot_cell_controlled.urdf.xacro"]),
PathJoinSubstitution(
[
FindPackageShare("my_robot_cell_control"),
"urdf",
"my_robot_cell_controlled.urdf.xacro",
]
),
" ",
"robot_ip:=",
robot_ip,
Expand Down Expand Up @@ -113,12 +116,12 @@ def generate_launch_description():
DeclareLaunchArgument(
"kinematics_parameters_file",
default_value=PathJoinSubstitution(
[
FindPackageShare("my_robot_cell_control"),
"config",
"my_robot_calibration.yaml",
]
),
[
FindPackageShare("my_robot_cell_control"),
"config",
"my_robot_calibration.yaml",
]
),
description="The calibration configuration of the actual robot used.",
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument(
"robot_ip",
default_value="192.168.56.101", # put your robot's IP address here
description="IP address by which the robot can be reached."
default_value="192.168.56.101", # put your robot's IP address here
description="IP address by which the robot can be reached.",
)
)

Expand Down
41 changes: 21 additions & 20 deletions my_robot_cell/my_robot_cell_description/launch/view_robot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,34 @@

def generate_launch_description():
description_package = FindPackageShare("my_robot_cell_description")
description_file = PathJoinSubstitution([description_package, "urdf", "my_robot_cell.urdf.xacro"])
description_file = PathJoinSubstitution(
[description_package, "urdf", "my_robot_cell.urdf.xacro"]
)
rvizconfig_file = PathJoinSubstitution([description_package, "rviz", "urdf.rviz"])

robot_description = ParameterValue(Command(['xacro ', description_file, " ", "ur_type:=", "ur20"]),
value_type=str)
robot_description = ParameterValue(
Command(["xacro ", description_file, " ", "ur_type:=", "ur20"]), value_type=str
)

robot_state_publisher_node = Node(
package='robot_state_publisher',
executable='robot_state_publisher',
parameters=[{'robot_description': robot_description}]
)
package="robot_state_publisher",
executable="robot_state_publisher",
parameters=[{"robot_description": robot_description}],
)

joint_state_publisher_gui_node = Node(
package='joint_state_publisher_gui',
executable='joint_state_publisher_gui',
)
package="joint_state_publisher_gui",
executable="joint_state_publisher_gui",
)

rviz_node = Node(
package='rviz2',
executable='rviz2',
name='rviz2',
output='screen',
arguments=['-d', rvizconfig_file],
package="rviz2",
executable="rviz2",
name="rviz2",
output="screen",
arguments=["-d", rvizconfig_file],
)

return LaunchDescription([
joint_state_publisher_gui_node,
robot_state_publisher_node,
rviz_node
])
return LaunchDescription(
[joint_state_publisher_gui_node, robot_state_publisher_node, rviz_node]
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@


def generate_launch_description():
moveit_config = MoveItConfigsBuilder("my_robot_cell", package_name="my_robot_cell_moveit_config").to_moveit_configs()
moveit_config = MoveItConfigsBuilder(
"my_robot_cell", package_name="my_robot_cell_moveit_config"
).to_moveit_configs()
return generate_move_group_launch(moveit_config)
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@


def generate_launch_description():
moveit_config = MoveItConfigsBuilder("my_robot_cell", package_name="my_robot_cell_moveit_config").to_moveit_configs()
moveit_config = MoveItConfigsBuilder(
"my_robot_cell", package_name="my_robot_cell_moveit_config"
).to_moveit_configs()
return generate_moveit_rviz_launch(moveit_config)
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@


def generate_launch_description():
moveit_config = MoveItConfigsBuilder("my_robot_cell", package_name="my_robot_cell_moveit_config").to_moveit_configs()
moveit_config = MoveItConfigsBuilder(
"my_robot_cell", package_name="my_robot_cell_moveit_config"
).to_moveit_configs()
return generate_setup_assistant_launch(moveit_config)
3 changes: 1 addition & 2 deletions ur_documentation/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
# ones.
extensions = [
"sphinx.ext.todo",
'sphinx_rtd_theme',

"sphinx_rtd_theme",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ joints are in the 0 position. Hence, the collision is allowed as "Collision by d
that tick, since we don't want that collision to be ignored.

.. image:: self_collisions.png
:alt: Adjust self-collisions - Remove the tick for the collsion between monitor and ur20_upper_arm_link.
:alt: Adjust self-collisions - Remove the tick for the collision between monitor and ur20_upper_arm_link.


We skip adding virtual joints for now and continue with our **planning group(s)**.
Expand Down

0 comments on commit 2961d50

Please sign in to comment.