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

README with instructions for occupancy grid #51

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN apt-get update --fix-missing
RUN apt-get install -y vim

# Install pip (updating is important!)
RUN apt-get install -y python3-pip=22.0.2+dfsg-1ubuntu0.4 && pip3 install --upgrade pip
RUN apt-get install -y python3-pip && pip3 install --upgrade pip

# Setup ROSboard
RUN apt-get install -y \
Expand Down
98 changes: 98 additions & 0 deletions READMELIDAR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# LiDAR-Based Occupancy Grid Generation

This guide provides instructions for generating a live occupancy grid from our LiDAR data (Unitree L1) and creating an occupancy grid from recorded LiDAR data using ROS.

## Prerequisites
Make sure to have a ROS workspace set up and the necessary packages installed:
- `unitree_lidar_ros` (for handling LiDAR data)
- `pointcloud_to_grid` (for converting point clouds to an occupancy grid)

## Part 1: Creating a Live Occupancy Grid from LiDAR

### Steps

1. **Terminal 1** - Initialize the ROS core and build workspace:
```bash
cd ~/catkin_ws
catkin build pointcloud_to_grid
source devel/setup.bash
roscore
```

2. **Terminal 2** - Launch the LiDAR node:
```bash
cd ~/catkin_ws/src/unilidar_sdk/unitree_lidar_ros
catkin_make
source devel/setup.bash
roslaunch unitree_lidar_ros run.launch
```

3. **Terminal 3** - Launch the occupancy grid generation node:
```bash
cd ~/catkin_ws
catkin build pointcloud_to_grid
source devel/setup.bash
roslaunch pointcloud_to_grid demo.launch
```

4. **Terminal 4** - Launch RViz to visualize the occupancy grid:
```bash
cd ~/catkin_ws
catkin build pointcloud_to_grid
source devel/setup.bash
roslaunch pointcloud_to_grid rviz.launch
```

## Part 2: Generating Occupancy Grid from a Recorded Bag File

### Recording a Bag File

1. **Terminal 1** - Launch the LiDAR node to start recording:
```bash
cd ~/catkin_ws/src/unilidar_sdk/unitree_lidar_ros
catkin_make
source devel/setup.bash
roslaunch unitree_lidar_ros run.launch
```

2. **Terminal 2** - Start recording LiDAR data:
```bash
rosbag record -O {enter_name_here}.bag /cloud
```
- **Note**: Press `Ctrl+C` to stop recording when desired. Once recorded, close both terminals.

### Playing Back the Bag File and Generating Occupancy Grid

1. **Terminal 1** - Initialize the ROS core:
```bash
cd ~/catkin_ws
catkin build pointcloud_to_grid
source devel/setup.bash
roscore
```

2. **Terminal 2** - Play back the recorded bag file:
```bash
cd ~/catkin_ws
catkin build pointcloud_to_grid
source devel/setup.bash
rosbag play -l {enter_name_of_bag_file_here}.bag
```

3. **Terminal 3** - Launch the occupancy grid generation node:
```bash
cd ~/catkin_ws
catkin build pointcloud_to_grid
source devel/setup.bash
roslaunch pointcloud_to_grid demo.launch
```

4. **Terminal 4** - Launch RViz to visualize the occupancy grid:
```bash
cd ~/catkin_ws
catkin build pointcloud_to_grid
source devel/setup.bash
roslaunch pointcloud_to_grid rviz.launch
```


Loading