Skip to content

Commit

Permalink
Merge pull request #3 from secorolab/feature/refactor
Browse files Browse the repository at this point in the history
Feature/refactor
  • Loading branch information
vamsikalagaturu authored Dec 18, 2024
2 parents 1d1e912 + 6c52d6a commit 2effc22
Show file tree
Hide file tree
Showing 33 changed files with 1,705 additions and 731 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: ros-tooling/[email protected]
with:
required-ros-distributions: jazzy
- uses: ros-tooling/[email protected]
with:
target-ros2-distro: jazzy
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/ci_dep.repos"
package-name: kortex_description robotiq_description eddie_description eddie_gazebo
13 changes: 13 additions & 0 deletions .github/workflows/ci_dep.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repositories:
ros2_kortex:
type: git
url: https://github.com/secorolab/ros2_kortex.git
version: main
ros2_robotiq_gripper:
type: git
url: https://github.com/PickNikRobotics/ros2_robotiq_gripper.git
version: main
eddie_description:
type: git
url: https://github.com/secorolab/eddie_description.git
version: main
22 changes: 22 additions & 0 deletions .github/workflows/deploy-mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish docs with MkDocs via GitHub Pages
on:
push:
branches:
- main
jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[docs]"
- name: Deploy MkDocs
run: mkdocs gh-deploy --force
31 changes: 31 additions & 0 deletions .github/workflows/format_and_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Formatting and Linting
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
setup-build-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('**/.pre-commit-config.yaml') }}
restore-keys: |
pre-commit-${{ runner.os }}-
- name: Run pre-commit checks
working-directory: ${{ github.workspace }}
run: |
pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks
# Run pre-commit checks
pre-commit run --show-diff-on-failure --color=always --all-files
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ log/
__pycache__/
*.pyc

.ruff_cache

venv/
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-xml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
hooks:
- id: ruff
args: [--line-length=100, --fix]
- id: ruff-format
- repo: https://github.com/google/yamlfmt
rev: v0.10.0
hooks:
- id: yamlfmt
args: ['-formatter', 'max_line_length=100']
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ robot.
- **Gazebo Version**: Harmonic

```bash
sudo apt-get install ros-jazzy-ros-gz
sudo apt-get install ros-jazzy-ros-gz ros-jazzy-simple-launch
```

- Ensure that the environment variable `GZ_VERSION` is set to `harmonic` when building the
Expand Down Expand Up @@ -110,7 +110,7 @@ sudo docker run -it --rm --runtime=nvidia --gpus all \
### Launch the simulation

```bash
ros2 launch eddie_gazebo eddie_gazebo.launch.py
ros2 launch eddie_gazebo run_sim.launch.py
```

- To move the base using `Teleop`, select the `Teleop` from the `Tools` menu in the Gazebo GUI.
Expand All @@ -120,13 +120,13 @@ ros2 launch eddie_gazebo eddie_gazebo.launch.py
1. By default, the `base_controller` for controlling the mobile base is a velocity controller and
the `arm_controller` for controlling the Kinova arms is a `trajectory_controller`. You can
customize the base_controller and arm_controller by providing launch arguments, for example:

<!--
```bash
ros2 launch eddie_gazebo eddie_gazebo.launch.py arm_controller:=joint_trajectory base_controller:=position
```

- Valid values for `arm_controller` are `joint_trajectory` and `effort`.
- Valid values for `base_controller` are `position`, `velocity`, and `effort`.
- Valid values for `base_controller` are `position`, `velocity`, and `effort`. -->

2. The `joint_trajectory` controller can accept position as well as velocity commands.

Expand Down Expand Up @@ -198,13 +198,13 @@ ros2 run rqt_controller_manager rqt_controller_manager --force-discover
```
In the UI, if controller_manager is not already selected, choose it from the dropdown menu. ![Select
the namespace(controller_manager)](/doc/images/namespace.png)
the namespace(controller_manager)](docs/images/namespace.png)
To unload a controller, right-click on the desired controller and select "De-activate and Unload".
![Unload the controller for left arm/right arm/base](/doc/images/unload.png)
![Unload the controller for left arm/right arm/base](docs/images/unload.png)
To load the desired controller, right-click on it and select 'Load, Configure and activate'. ![Load
the controller for left arm/right arm/base](/doc/images/load.png)
the controller for left arm/right arm/base](docs/images/load.png)
### Note
Expand Down
119 changes: 45 additions & 74 deletions config/eddie_controller.yaml → config/eddie_controllers.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,30 @@
controller_manager:
ros__parameters:
update_rate: 1000 # Hz

update_rate: 1000 # Hz
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

arm_right_joint_trajectory_controller:
type: joint_trajectory_controller/JointTrajectoryController

arm_left_joint_trajectory_controller:
type: joint_trajectory_controller/JointTrajectoryController

arm_right_effort_controller:
type: effort_controllers/JointGroupEffortController

arm_left_effort_controller:
type: effort_controllers/JointGroupEffortController

base_position_controller:
type: position_controllers/JointGroupPositionController

base_velocity_controller:
type: velocity_controllers/JointGroupVelocityController

base_effort_controller:
type: effort_controllers/JointGroupEffortController

arm_left_joint_trajectory_controller:
ros__parameters:
joints:
- kinova_left_joint_1
- kinova_left_joint_2
- kinova_left_joint_3
- kinova_left_joint_4
- kinova_left_joint_5
- kinova_left_joint_6
- kinova_left_joint_7
- eddie_left_arm_joint_1
- eddie_left_arm_joint_2
- eddie_left_arm_joint_3
- eddie_left_arm_joint_4
- eddie_left_arm_joint_5
- eddie_left_arm_joint_6
- eddie_left_arm_joint_7
command_interfaces:
- position
state_interfaces:
Expand All @@ -47,18 +36,16 @@ arm_left_joint_trajectory_controller:
constraints:
stopped_velocity_tolerance: 0.0
goal_time: 0.0


arm_right_joint_trajectory_controller:
ros__parameters:
joints:
- kinova_right_joint_1
- kinova_right_joint_2
- kinova_right_joint_3
- kinova_right_joint_4
- kinova_right_joint_5
- kinova_right_joint_6
- kinova_right_joint_7
- eddie_right_arm_joint_1
- eddie_right_arm_joint_2
- eddie_right_arm_joint_3
- eddie_right_arm_joint_4
- eddie_right_arm_joint_5
- eddie_right_arm_joint_6
- eddie_right_arm_joint_7
command_interfaces:
- position
state_interfaces:
Expand All @@ -70,17 +57,16 @@ arm_right_joint_trajectory_controller:
constraints:
stopped_velocity_tolerance: 0.0
goal_time: 0.0

arm_right_effort_controller:
ros__parameters:
joints:
- kinova_right_joint_1
- kinova_right_joint_2
- kinova_right_joint_3
- kinova_right_joint_4
- kinova_right_joint_5
- kinova_right_joint_6
- kinova_right_joint_7
- eddie_right_arm_joint_1
- eddie_right_arm_joint_2
- eddie_right_arm_joint_3
- eddie_right_arm_joint_4
- eddie_right_arm_joint_5
- eddie_right_arm_joint_6
- eddie_right_arm_joint_7
command_interfaces:
- effort
state_interfaces:
Expand All @@ -92,17 +78,16 @@ arm_right_effort_controller:
constraints:
stopped_velocity_tolerance: 0.0
goal_time: 0.0

arm_left_effort_controller:
ros__parameters:
joints:
- kinova_left_joint_1
- kinova_left_joint_2
- kinova_left_joint_3
- kinova_left_joint_4
- kinova_left_joint_5
- kinova_left_joint_6
- kinova_left_joint_7
- eddie_left_arm_joint_1
- eddie_left_arm_joint_2
- eddie_left_arm_joint_3
- eddie_left_arm_joint_4
- eddie_left_arm_joint_5
- eddie_left_arm_joint_6
- eddie_left_arm_joint_7
command_interfaces:
- effort
state_interfaces:
Expand All @@ -114,39 +99,25 @@ arm_left_effort_controller:
constraints:
stopped_velocity_tolerance: 0.0
goal_time: 0.0

base_position_controller:
ros__parameters:
joints:
- kelo_drive_front_left_hub_left_joint
- kelo_drive_front_left_hub_right_joint
- kelo_drive_front_right_hub_left_joint
- kelo_drive_front_right_hub_right_joint
- kelo_drive_rear_right_hub_left_joint
- kelo_drive_rear_right_hub_right_joint
- kelo_drive_rear_left_hub_left_joint
- kelo_drive_rear_left_hub_right_joint

base_velocity_controller:
ros__parameters:
joints:
- kelo_drive_front_left_hub_left_joint
- kelo_drive_front_left_hub_right_joint
- kelo_drive_front_right_hub_left_joint
- kelo_drive_front_right_hub_right_joint
- kelo_drive_rear_right_hub_left_joint
- kelo_drive_rear_right_hub_right_joint
- kelo_drive_rear_left_hub_left_joint
- kelo_drive_rear_left_hub_right_joint

- eddie_front_left_drive_l_wheel_joint
- eddie_front_left_drive_r_wheel_joint
- eddie_rear_left_drive_l_wheel_joint
- eddie_rear_left_drive_r_wheel_joint
- eddie_rear_right_drive_l_wheel_joint
- eddie_rear_right_drive_r_wheel_joint
- eddie_front_right_drive_l_wheel_joint
- eddie_front_right_drive_r_wheel_joint
base_effort_controller:
ros__parameters:
joints:
- kelo_drive_front_left_hub_left_joint
- kelo_drive_front_left_hub_right_joint
- kelo_drive_front_right_hub_left_joint
- kelo_drive_front_right_hub_right_joint
- kelo_drive_rear_right_hub_left_joint
- kelo_drive_rear_right_hub_right_joint
- kelo_drive_rear_left_hub_left_joint
- kelo_drive_rear_left_hub_right_joint
- eddie_front_left_drive_l_wheel_joint
- eddie_front_left_drive_r_wheel_joint
- eddie_rear_left_drive_l_wheel_joint
- eddie_rear_left_drive_r_wheel_joint
- eddie_rear_right_drive_l_wheel_joint
- eddie_rear_right_drive_r_wheel_joint
- eddie_front_right_drive_l_wheel_joint
- eddie_front_right_drive_r_wheel_joint
37 changes: 37 additions & 0 deletions config/gz_ros_bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
- ros_topic_name: "/clock"
gz_topic_name: "/world/eddie_world/clock"
ros_type_name: "rosgraph_msgs/msg/Clock"
gz_type_name: "gz.msgs.Clock"
direction: GZ_TO_ROS
- ros_topic_name: "/cmd_vel"
gz_topic_name: "/model/eddie/cmd_vel"
ros_type_name: "geometry_msgs/msg/Twist"
gz_type_name: "gz.msgs.Twist"
direction: ROS_TO_GZ
- ros_topic_name: "odom"
gz_topic_name: "/model/eddie/odometry"
ros_type_name: "nav_msgs/msg/Odometry"
gz_type_name: "gz.msgs.Odometry"
direction: "GZ_TO_ROS"
- ros_topic_name: "imu"
gz_topic_name: "/eddie_imu"
ros_type_name: "sensor_msgs/msg/Imu"
gz_type_name: "gz.msgs.IMU"
direction: GZ_TO_ROS
# Laser scan topics
- ros_topic_name: "scan"
gz_topic_name: "/eddie_front_right_laser"
ros_type_name: "sensor_msgs/msg/LaserScan"
gz_type_name: "gz.msgs.LaserScan"
direction: GZ_TO_ROS
# - ros_topic_name: "scan"
# gz_topic_name: "/eddie_rear_left_laser"
# ros_type_name: "sensor_msgs/msg/LaserScan"
# gz_type_name: "gz.msgs.LaserScan"
# direction: GZ_TO_ROS
# odom to base_footprint transform
- ros_topic_name: "/tf"
gz_topic_name: "/model/eddie/pose"
ros_type_name: "tf2_msgs/msg/TFMessage"
gz_type_name: "gz.msgs.Pose_V"
direction: GZ_TO_ROS
File renamed without changes
File renamed without changes
File renamed without changes
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Eddie Gazebo Simulation
6 changes: 6 additions & 0 deletions docs/styles/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:root {
--md-primary-fg-color: #9d2246;
--md-primary-fg-color--light: #d50c2f;
--md-primary-fg-color--dark: #9d2246;
--md-accent-fg-color: #f39ca9;
}
Loading

0 comments on commit 2effc22

Please sign in to comment.