Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature scout mini rtabmap #8

Merged
merged 50 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
9c5063b
scout_mini: add rtabmap
PangKW-weston Jul 3, 2024
06c117a
wr_devkit_bringup: added rtab nav2
PangKW-weston Jul 8, 2024
e2d1379
rtabmap: testing with more parameters
PangKW-weston Jul 11, 2024
c178fac
rtabmap: fine tuning parameters
PangKW-weston Jul 11, 2024
00f02d4
rtabmap: added camera launch description
PangKW-weston Jul 11, 2024
d2c3fc9
rtamap: realsense launch name correction
PangKW-weston Jul 11, 2024
a6268bc
rtabmap: added camera static tf
PangKW-weston Jul 11, 2024
f68f96e
rtabmap: relink tf
PangKW-weston Jul 11, 2024
b5e089e
rtabmap: vslam cleanup
PangKW-weston Jul 11, 2024
01547e2
rtabmap: vslam cleanup
PangKW-weston Jul 11, 2024
9bbfb35
rtabmap: map and nav file clean up
PangKW-weston Jul 12, 2024
00d833f
Updated Readme
PangKW-weston Jul 12, 2024
0add25c
devkit urdf: added mesh files and camera layer
PangKW-weston Jul 17, 2024
fdbd584
devkit urdf: bugfix
PangKW-weston Jul 17, 2024
0b05c6f
urdf: added realsense xacro macro
PangKW-weston Jul 17, 2024
c66b5b4
devkit: added camera layer urdf
PangKW-weston Jul 30, 2024
ea78942
rtab: added rtab nav2 voxel layer with d435 pointcloud
PangKW-weston Jul 30, 2024
1c2b198
Updated Readme
PangKW-weston Jul 30, 2024
f814a6a
realsense: updated stable resolution
PangKW-weston Jul 31, 2024
3536777
Updated readme
PangKW-weston Aug 1, 2024
980e7d1
Brnigup: added camera condition and ros2 packages
PangKW-weston Aug 1, 2024
82c38d5
platform: lowered realsense resolution
PangKW-weston Aug 1, 2024
6307cb7
Updated readme
PangKW-weston Aug 1, 2024
fc7d918
Updated readme
PangKW-weston Aug 5, 2024
24df2e3
Update README.md
PangKW-weston Aug 6, 2024
d1322bc
top_sensor_kit: supports multiple realsense camera launch
PangKW-weston Aug 21, 2024
7a2a078
top urdf: xacro: Rename perception_kit to camera_kit
PangKW-weston Aug 21, 2024
732a85d
Rename mid360_sensor_kit to perception_sensor_kit
PangKW-weston Aug 21, 2024
c12e5bd
rgb camera: add usb cam driver and launch node
PangKW-weston Sep 10, 2024
bf4484f
Update README
PangKW-weston Sep 10, 2024
47fe404
rgb_cam: update camera tf frame and urdf
PangKW-weston Sep 10, 2024
3563a45
ci: add release workflows for versioning
hanskw-weston Sep 11, 2024
20569eb
package.xml: add version
hanskw-weston Sep 11, 2024
0175078
docs: split readme to smaller more digestible sections
hanskw-weston Sep 11, 2024
aa82de7
kit: top: rename perception kit back to mid360
hanskw-weston Sep 11, 2024
955e36c
kits: top: rename perception kit to mid360
hanskw-weston Sep 11, 2024
23274b4
top: mid360: remove camera related launch
hanskw-weston Sep 11, 2024
fdb4e76
kits: top: add separate vision kit for camera kit
hanskw-weston Sep 11, 2024
c53f311
top: vision: add camera driver launch
hanskw-weston Sep 11, 2024
4858323
kits: top: update readmes
hanskw-weston Sep 11, 2024
22a4413
kit: top: rename rgb camera param file
hanskw-weston Sep 11, 2024
76f5250
bringup: add vision kit to platform launch
hanskw-weston Sep 11, 2024
2da5177
kits: top: vision: adjust cam frame names
hanskw-weston Sep 11, 2024
75927e0
kits: top: add vision kit pic
hanskw-weston Sep 11, 2024
9c4c022
Merge pull request #9 from westonrobot/cleanup-docs
hanskw-weston Sep 11, 2024
5aa1570
readme: add vision kit to main readme
hanskw-weston Sep 12, 2024
11d28ff
docs: update docs
hanskw-weston Sep 12, 2024
6e27a2b
bugfix: fix camera names
hanskw-weston Sep 12, 2024
8399a13
kits: top: rename d435 param files to use d435i
hanskw-weston Sep 12, 2024
992819d
Merge pull request #10 from westonrobot/bugfix-cam
hanskw-weston Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: release-github

on:
push:
tags:
- "*"
workflow_dispatch:

env:
CONAN_USER: ${{ secrets.ARTIFACTORY_CONAN_USERNAME }}
CONAN_TOKEN: ${{ secrets.ARTIFACTORY_CONAN_ACCESS_TOKEN }}

jobs:
release:
runs-on: ["ubuntu-latest"]
container: "westonrobot/ubuntu:jammy-ci-latest"
defaults:
run:
shell: bash
permissions:
contents: write
steps:
- name: Create release
uses: westonrobot-dev/[email protected]
with:
generateReleaseNotes: true
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: release

on:
push:
branches:
- "main"

env:
VERSION: 0.1.0

jobs:
tag-release:
runs-on: ["ubuntu-latest"]
container: "westonrobot/ubuntu:jammy-ci-latest"
steps:
- name: Create tag
continue-on-error: true
if: github.ref_name == 'main'
uses: westonrobot-dev/[email protected]
id: tag_version
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.VERSION }}
release_branches: "main"
pre_release_branches: "prerelease"
- name: Create Github Release
if: github.ref_name == 'main' && steps.tag_version.outcome == 'success'
uses: westonrobot-dev/[email protected]
with:
workflow: release-github.yml
ref: ${{ steps.tag_version.outputs.new_tag }}
149 changes: 16 additions & 133 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

![default workflow](https://github.com/westonrobot/wr_devkit_navigation/actions/workflows/default.yml/badge.svg?branch=main)

This repository provides a reference setup when using the mobile robot development kit from Weston Robot.
This repository provides a head start for mobile robot development when using the development kit from Weston Robot.

## Requirements
The code contained in this repository is meant to be used as a reference for integrating Weston Robot's hardware with ROS2's Navigation2 stack. It includes sample launch files for bringing up the robot, running SLAM, and navigation applications.

**Code is provided `as-is` and may require modifications to work with your specific hardware configuration.**

## Hardware Requirements
The following hardware configurations are supported:

### Chassis
Expand All @@ -14,147 +17,27 @@ The following hardware configurations are supported:
| UGV Development Kit V1.0 | [wiki](https://docs.westonrobot.net/wr_dev_kit/ugv_dev_kit_v1.html) | [ugv_devkit_v1_bringup](./src/kits/chassis/ugv_devkit_v1_bringup/) |

### Sensor Kits
| Sensor kit | Mount Location | Documentation | Source Code |
| ------------------------ | -------------- | ------------- | ---------------------------------------------------------------------- |
| Livox Mid360 Lidar + IMU | Top | TBD | [mid360_sensor_kit_bringup](./src/kits/top/mid360_sensor_kit_bringup/) |
| W200D Ultrasonic Sensors | Base | TBD | [w200d_sensor_kit_bringup](./src/kits/base/w200d_sensor_kit_bringup/) |
| Sensor kit | Mount Location | Documentation | Source Code |
| ------------------------ | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| Livox Mid360 Lidar + IMU | Top | [docs](https://docs.westonrobot.com/wr_dev_kit/ugv_dev_kit_v1/ugv_devkit_mid360_extension.html#ref-ugv-devkit-livox-mid360-imu-extension) | [mid360_sensor_kit_bringup](./src/kits/top/mid360_sensor_kit_bringup/) |
| Vision | Top | [docs](https://docs.westonrobot.com/wr_dev_kit/ugv_dev_kit_v1/ugv_devkit_vision_extension.html#ref-ugv-devkit-vision-extension) | [vision_sensor_kit_bringup](./src/kits/top/vision_sensor_kit_bringup/) |
| W200D Ultrasonic Sensors | Base | TBD | [w200d_sensor_kit_bringup](./src/kits/base/w200d_sensor_kit_bringup/) |

### Robot Bases
| Base | Documentation |
| --------------- | ---------------------------------------------------------------------------------- |
| Ranger Mini 2.0 | [wiki](https://docs.westonrobot.com/robot_user_guide/agilex/ranger_mini_v2.0.html) |
| Scout Mini | [wiki](https://docs.westonrobot.com/robot_user_guide/agilex/scout_mini.html) |
| Scout Mini | [wiki](https://docs.westonrobot.com/robot_user_guide/agilex/scout_mini.html) |

**Note**: Robot bases are used for testing and development purposed only. Other robot bases should also be compatible with the provided chassis and sensor kits.
**Note**: Robot bases are used for testing and development purposes only. Other robot bases should also be compatible with the provided chassis and sensor kits.

### Onboard Computer
| Operating System | Framework |
| ---------------- | ------------------------------------------------------------------------------------- |
| Operating System | Framework |
| ---------------- | -------------------------------------------------------------------------------------- |
| Ubuntu 22.04 | [ROS2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html) |


## Installation

* Install the Weston Robot Platform SDK (wrp-sdk)

```bash
$ sudo install -m 0755 -d /etc/apt/keyrings
$ curl -fsSL http://deb.westonrobot.net/signing.key | sudo gpg --dearmor -o /etc/apt/keyrings/weston-robot.gpg
$ sudo chmod a+r /etc/apt/keyrings/weston-robot.gpg

$ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/weston-robot.gpg] http://deb.westonrobot.net/$(lsb_release -cs) $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/weston-robot.list > /dev/null

$ sudo apt-get update
$ sudo apt-get install wrp-sdk

# Install drivers for peripherals
$ sudo apt-get install -y software-properties-common
$ sudo add-apt-repository ppa:lely/ppa
$ sudo apt-get update

$ sudo apt-get install liblely-coapp-dev liblely-co-tools python3-dcf-tools pkg-config
```

Please refer to [this page](https://docs.westonrobot.com/software/installation_guide.html) for more details of the installation steps.


* Install ugv_sdk dependencies
```bash
sudo apt-get install build-essential git cmake libasio-dev
```

* Install Livox SDK2 (if you have the Livox Mid360 Lidar + IMU sensor kit)

```bash
$ cd ~
$ git clone https://github.com/Livox-SDK/Livox-SDK2.git
$ cd Livox-SDK2
$ mkdir build && cd build && cmake .. && make
$ sudo make install
```

> **Note:** You can build and install the Livox-SDK2 at your preferred places other than "~/Livox-SDK2". And you can optionally remove the "Livox-SDK2" folder after installation.

* Import the ROS driver packages into the workspace and build

```bash
$ cd <your-workspace>/wr_devkit_navigation

# Clone dependencies
$ vcs import --recursive src < ./navigation.repos

$ source /opt/ros/humble/setup.bash
$ colcon build --symlink-install
```

The build process should finish without any errors.

* Install ROS packages **(Make sure you have ros2 installed first)**
```bash
$ chmod +x ros2_packages.sh
$ ./ros2_packages.sh
```
Please refer to the [installation guide](/docs/INSTALLATION.md) for detailed instructions on setting up your development environment.

## Running the packages
Sample launch files can be found in the [wr_devkit_bringup](./src/wr_devkit_bringup/) package. They are meant to be used as a starting point for your own development and can be customized to your needs.

Below is the typical workflow to bring up the robot and run some sample applications.
**Remember to source the ROS Workspace first and optionally set ROS_DOMAIN_ID**

* Bringup CAN Bus
```bash
$ sudo ip link set can0 up type can bitrate 500000
$ sudo ip link set can0 txqueuelen 1000
```

| Base | robot_model |robot_param |
| -------------------------- | ---------------------- |----------------------------------- |
| Ranger Mini 2.0 (default) | ranger_mini_v2 |nav2_ranger_mini.param.yaml |
| Scout Mini | scout_mini |nav2_scout_mini.param.yaml |
> **Note:** Ensure the `robot_model` and `robot_param` arguments in the command line match your specific robot configuration. Adjust the launch file as necessary to align with your hardware and software setup

### Sample 2D SLAM ([Cartographer Mapping](https://google-cartographer-ros.readthedocs.io/en/latest/index.html))

* Bringup Robot
```bash
$ ros2 launch wr_devkit_bringup wr_devkit_platform.launch.py robot_model:=ranger_mini_v2
```

* SLAM
```bash
$ ros2 launch wr_devkit_bringup wr_devkit_cartographer.launch.py

# Control via RC or teleop
$ ros2 run teleop_twist_keyboard teleop_twist_keyboard.py
```
> **Note:** The speed should be slow during the mapping process. If the speed is too fast, the map quality will be affected

* Map Saving
```bash
$ cd Workspace/wr_devkit_navigation/src/wr_devkit_bringup/maps
$ ros2 run nav2_map_server map_saver_cli -f <your_map_name>
```

### Sample Navigation ([Nav2](https://docs.nav2.org/index.html))

* Bringup Robot
```bash
$ ros2 launch wr_devkit_bringup wr_devkit_platform.launch.py robot_model:=ranger_mini_v2
```

* Launch Nav2
```bash
$ ros2 launch wr_devkit_bringup wr_devkit_nav2.launch.py robot_param:=nav2_ranger_mini.param.yaml map:=<your_map_yaml>
```
* You may want to hardcode the absolute path of the pgm file in the map yaml file
* Map to odom frame will not be published until you provide an initial pose estimate
* You can run rviz2 on another pc via
```bash
$ ros2 launch nav2_bringup rviz_launch.py
```


## Notes
* The sample applications (Nav2/SLAM) are designed to be ran separately and should not be ran at the same time.
Please refer to the [running guide](/docs/RUN.md) for detailed instructions on running the sample applications.
86 changes: 86 additions & 0 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Installation Guide

## Getting this repository
This repository is intended to be used as a ROS2 colcon workspace itself (i.e. you do not need to create your own colcon workspace, though it is possible to do so).

```bash
$ mkdir -p <parent-directory>
$ cd <parent-directory>
$ git clone https://github.com/westonrobot/wr_devkit_navigation.git
```

## Install Dependencies
Each sensor kit and robot base has its own set of dependencies. Please follow the instructions below to install the necessary items for your specific hardware configuration.

### Common Dependencies
The following dependencies are common to multiple sensor kits and robot bases and should be installed regardless of the specific hardware configuration.

* Weston Robot Platform SDK
```bash
$ sudo install -m 0755 -d /etc/apt/keyrings
$ curl -fsSL http://deb.westonrobot.net/signing.key | sudo gpg --dearmor -o /etc/apt/keyrings/weston-robot.gpg
$ sudo chmod a+r /etc/apt/keyrings/weston-robot.gpg

$ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/weston-robot.gpg] http://deb.westonrobot.net/$(lsb_release -cs) $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/weston-robot.list > /dev/null

$ sudo apt-get update
$ sudo apt-get install wrp-sdk

# Install drivers/dependencies for peripherals
$ sudo apt-get install -y software-properties-common
$ sudo add-apt-repository ppa:lely/ppa
$ sudo apt-get update
$ sudo apt-get install liblely-coapp-dev liblely-co-tools python3-dcf-tools pkg-config
```
> Please refer to [this page](https://docs.westonrobot.com/software/installation_guide.html) for more details of the installation steps.
> Documentation for the Weston Robot Platform SDK can be found [here](https://github.com/westonrobot/wrp_sdk).

### Sensor Kits Dependencies
The following dependencies are specific to each sensor kit and should be installed according to the specific hardware configuration.

#### Livox Mid360 Lidar + IMU Sensor Kit
* Livox SDK2
```bash
$ cd ~
$ git clone https://github.com/Livox-SDK/Livox-SDK2.git
$ cd Livox-SDK2
$ mkdir build && cd build && cmake .. && make
$ sudo make install
```
> **Note:** You can build and install the Livox-SDK2 at your preferred places other than "~/Livox-SDK2". And you can optionally remove the "Livox-SDK2" folder after installation.

### Robot Bases Dependencies
The following dependencies are specific to each robot base and should be installed according to the specific hardware configuration.

#### Ranger Mini 2.0 & Scout Mini
* ugv_sdk dependencies
```bash
sudo apt-get install build-essential git cmake libasio-dev
```

### ROS Driver Packages
All ROS driver packages are listed in the [navigation.repos](/navigation.repos) file. You can import the ROS driver packages by running the following command:
```bash
$ vcs import --recursive src < ./navigation.repository
```
> **Note:** You might not need to build all the driver packages. You can comment out the packages you do not need in the `navigation.repos` file. Refer to the table below for the ROS driver packages for each sensor kit and robot base.


| Component | ROS Driver Packages Needed |
| ----------------------------------- | ------------------------------ |
| Livox Mid360 Lidar + IMU Sensor Kit | livox_ros_driver2<br/>wrp_ros2 |
| Vision Sensor Kit | realsense-ros<br/>usb_cam |
| W200d Sensor Kit | wrp_ros2 |
| Ranger Mini 2.0 | ranger_ros2<br/>ugv_sdk |
| Scout Mini | scout_ros2<br/>ugv_sdk |

## Build the Workspace

After installing the dependencies, you can build the workspace by running the following commands:
```bash
$ cd <parent-directory>/wr_devkit_navigation
$ source /opt/ros/humble/setup.bash
$ colcon build --symlink-install
```
Loading