Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
315681c
added cev_msgs include
sophtsang Oct 16, 2025
ba9cba0
BEV and OBB conversions now work with live cluster outputs from /rsli…
sophtsang Oct 17, 2025
9cd11ab
Merged elements of PointCloud2 array into one PointCloud2 pc, while k…
sophtsang Oct 23, 2025
4b1f96e
intro to rasterization
sophtsang Nov 1, 2025
0ee1404
new script for occupancy grid conversions
sophtsang Nov 5, 2025
5045a94
added required stuff for occupancy_grid in CmakeLists.txt
sophtsang Nov 5, 2025
4288ea5
test
sophtsang Nov 5, 2025
97c2663
pub bev points to bev_points
sophtsang Nov 6, 2025
393f073
]Merge branch 'tmp_changes' of https://github.com/cornellev/Obstacle_…
sophtsang Nov 6, 2025
d4862c3
please work
sophtsang Nov 6, 2025
268cda5
successfully implemented occupancy grid w/ obstacle point clouds
sophtsang Nov 7, 2025
de5c14a
added some occupancy grid pics to readme
sophtsang Nov 7, 2025
52f647f
demo imgs
sophtsang Nov 7, 2025
1d1ce5a
mispelled
sophtsang Nov 7, 2025
cb3f1e8
removed unnecessary method
sophtsang Nov 7, 2025
5794fff
param changes
sophtsang Nov 8, 2025
a65a76c
integrated pcCallback to take in /rslidar_clusters topic of PointClou…
sophtsang Nov 13, 2025
1f9f1cf
integrated pcCallback to take in /rslidar_clusters topic of PointClou…
sophtsang Nov 13, 2025
d6df87f
method signatures for MHT and icp-based bipartite matching
sophtsang Nov 13, 2025
a6cb1b2
initialize bipartite graph
sophtsang Nov 18, 2025
a70dce9
some changes
sophtsang Nov 18, 2025
d96caf5
modifications to icp in overlay
sophtsang Nov 18, 2025
fc8369c
another overlay
sophtsang Nov 19, 2025
87bf6c7
probably need to parallelize weighting each edge with icp
sophtsang Nov 21, 2025
f99edbe
square 2d vector for c_prev and c_curr bipartite adj matrix
sophtsang Dec 3, 2025
3e66718
cooked impl
sophtsang Dec 3, 2025
7776e7e
dying inside, at least matches, no way to visualize yet
sophtsang Dec 5, 2025
f10887b
preventing seg fault in iterating on empty clusters
sophtsang Dec 6, 2025
d6587f5
able to display matches w/ lines between centroids, runs so slowly im…
sophtsang Dec 6, 2025
3811958
switched from icp to box matching w/ iou edge cost, much faster
sophtsang Jan 24, 2026
9aa5590
added const velocity model for predicting next position and orientati…
sophtsang Jan 25, 2026
d4b70e2
obstacle_node stuff
sophtsang Jan 29, 2026
0c19717
debug shenan
sophtsang Jan 31, 2026
3d89c8d
new implementation of OBB for better representation of shape and orie…
sophtsang Jan 31, 2026
0b8fd4f
added new OBB implementation to obstacle_tracker
sophtsang Feb 3, 2026
845150f
merge
sophtsang Feb 3, 2026
1a64eb6
IoU is correct now
sophtsang Feb 3, 2026
e438ac8
attempts to make some predefined matches
sophtsang Feb 4, 2026
290fbd0
predefined
sophtsang Feb 7, 2026
764b1ac
pretty consistent cluster_ids w/ max bipartite + predefined matching,…
sophtsang Feb 8, 2026
58a4ea3
cleaned up obstacle_tracker and occupancy_grid so they don't update o…
sophtsang Apr 11, 2026
1adddee
nav2 costmap implementation
sophtsang Apr 21, 2026
105e2e5
listens to /rslidar_points
sophtsang Apr 21, 2026
7e11873
launch file for launching costmap
sophtsang Apr 21, 2026
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
24 changes: 24 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"configurations": [
{
"browse": {
"databaseFilename": "${default}",
"limitSymbolsToIncludedHeaders": false
},
"includePath": [
"/opt/ros/humble/include/**",
"/root/ws/src/ackermann_kf/go2_driver/include/**",
"/usr/include/**",
"${workspaceFolder}/**",
"/usr/include/opencv4",
"/root/ws/src/cev_msgs/**"
],
"name": "ROS",
"intelliSenseMode": "gcc-x64",
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "c++14"
}
],
"version": 4
}
86 changes: 83 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,126 @@ find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(cev_msgs REQUIRED)
find_package(PCL REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(pcl_ros REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Open3D REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)

find_package(nav2_costmap_2d REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/Obstacle.msg"
"msg/ObstacleArray.msg"
DEPENDENCIES std_msgs geometry_msgs
"msg/Box.msg"
"msg/Boxes.msg"
DEPENDENCIES std_msgs geometry_msgs cev_msgs nav_msgs
)

add_executable(obstacle_node src/obstacle_node.cpp)
add_executable(occupancy_grid src/occupancy_grid.cpp)
add_executable(obstacle_tracker src/obstacle_tracker.cpp)
add_executable(costmap_node src/costmap_node.cpp)

ament_target_dependencies(
obstacle_node
rclcpp
cev_msgs
sensor_msgs
std_msgs
pcl_conversions
pcl_ros
geometry_msgs
tf2
tf2_geometry_msgs
visualization_msgs
)

ament_target_dependencies(
occupancy_grid
rclcpp
cev_msgs
sensor_msgs
std_msgs
nav_msgs
pcl_conversions
pcl_ros
geometry_msgs
tf2
tf2_geometry_msgs
visualization_msgs
)

ament_target_dependencies(
obstacle_tracker
rclcpp
cev_msgs
sensor_msgs
std_msgs
nav_msgs
pcl_conversions
pcl_ros
geometry_msgs
tf2
tf2_geometry_msgs
visualization_msgs
)

ament_target_dependencies(costmap_node
rclcpp
nav2_costmap_2d
sensor_msgs
)

set(CEV_ICP_INCLUDE lib/cev_icp/include)
set(CEV_ICP_LIB lib/cev_icp/lib)

include_directories(${CEV_ICP_INCLUDE})
link_directories(${CEV_ICP_LIB})
include_directories(
${PCL_INCLUDE_DIRS}
)

target_link_libraries(obstacle_node
${OpenCV_LIBS}
${PCL_LIBRARIES}
Open3D::Open3D
)

ament_export_dependencies(rosidl_default_runtime)
target_link_libraries(occupancy_grid
${OpenCV_LIBS}
${PCL_LIBRARIES}
)

target_link_libraries(obstacle_tracker
${OpenCV_LIBS}
${PCL_LIBRARIES}
cevicp
Open3D::Open3D
)

ament_export_dependencies(rosidl_default_runtime)

rosidl_target_interfaces(obstacle_node
${PROJECT_NAME} "rosidl_typesupport_cpp")

rosidl_target_interfaces(occupancy_grid
${PROJECT_NAME} "rosidl_typesupport_cpp")

rosidl_target_interfaces(obstacle_tracker
${PROJECT_NAME} "rosidl_typesupport_cpp")

install(TARGETS
obstacle_node
occupancy_grid
obstacle_tracker
costmap_node
DESTINATION lib/${PROJECT_NAME})


Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# Obstacle_node
Hi all, I'm going to start yapping again!

## Angle Bins and Ray Tracing Via Bresenham's Line Algo

![Occupancy Grid 1](demos/occ.png)
![Occupancy Grid 2](demos/occupancygrid.png)

## Multi-Hypothesis Tracking
```
cd Obstacle_node
git submodule add https://github.com/cornellev/icp.git lib/cev_icp
git submodule update --init --recursive
cd lib/cev_icp
sudo make install LIB_INSTALL=/usr/local/lib HEADER_INSTALL=/usr/local/include
```

# Important Links
[Rasterize a point cloud](https://r-lidar.github.io/lasR/reference/rasterize.html)

[Dynamic Obstacle Detection and Tracking Based on 3D Lidar](https://www.jstage.jst.go.jp/article/jaciii/22/5/22_602/_pdf)
49 changes: 49 additions & 0 deletions config/costmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
costmap_node:
ros__parameters:

# --- Frame config ---
global_frame: map
robot_base_frame: base_link
transform_tolerance: 0.5

# --- Update rates ---
update_frequency: 10.0
publish_frequency: 5.0

# --- Grid dimensions ---
rolling_window: false # true = local costmap that follows robot
width: 20 # meters (only if rolling_window: false)
height: 20
resolution: 0.05 # meters/cell

# --- Robot shape ---
robot_radius: 0.3 # circular robot
# footprint: "[[0.3, 0.2], [0.3, -0.2], [-0.3, -0.2], [-0.3, 0.2]]" # polygon

# --- Plugins ---
plugins: ["obstacle_layer", "inflation_layer"]

obstacle_layer:
plugin: "nav2_costmap_2d::ObstacleLayer"
enabled: true
observation_sources: pointcloud_sensor
pointcloud_sensor:
topic: /rslidar_points # ← your PointCloud2 topic
data_type: PointCloud2
sensor_frame: "" # leave blank to use cloud's frame_id
observation_persistence: 0.0 # seconds to keep obs (0 = latest only)
expected_update_rate: 0.0 # 0 = no timeout check
min_obstacle_height: 0.0 # ignore floor points
max_obstacle_height: 2.0 # ignore ceiling points
obstacle_max_range: 6.0 # max range to mark occupied
obstacle_min_range: 0.0
raytrace_max_range: 20.0 # max range to clear free space
raytrace_min_range: 0.0
marking: true # mark obstacles
clearing: true # raycast to clear free space

inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
enabled: true
inflation_radius: 0.55 # meters, should be >= robot_radius
cost_scaling_factor: 10.0 # higher = sharper cost falloff
Binary file added demos/occ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demos/occupancygrid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions launch/launch_costmap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

source /opt/ros/humble/setup.bash
source /home/dev/ws/src/install/setup.bash

echo "Building packages..."
cd /home/dev/ws/src
colcon build --packages-select cev_msgs obstacle

echo "Sourcing workspace..."
source /home/dev/ws/src/install/setup.bash

echo "Starting TF publishers and costmap..."

# Run each in background
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 map base_link &
TF1_PID=$!

ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link rslidar &
TF2_PID=$!

# Small delay to let TF come up before costmap starts
sleep 1

ros2 run obstacle costmap_node &
COSTMAP_PID=$!

echo "Running. PIDs: tf1=$TF1_PID tf2=$TF2_PID costmap=$COSTMAP_PID"
echo "Press Ctrl+C to stop all."

# Wait and kill all on Ctrl+C
trap "kill $TF1_PID $TF2_PID $COSTMAP_PID; exit" SIGINT SIGTERM
wait
1 change: 1 addition & 0 deletions lib/cev_icp
Submodule cev_icp added at 2e12d9
23 changes: 23 additions & 0 deletions msg/Box.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Box.msg
#
# float64 : cx
# float64 : cy
# float64 : vx
# float64 : vy
# float64 : length
# float64 : width
# float64 : yaw
# float64 : yaw_rate
# int32 : cid
# bool : is_valid

float64 cx
float64 cy
float64 vx
float64 vy
float64 length
float64 width
float64 yaw
float64 yaw_rate
int32 cid
bool is_valid
7 changes: 7 additions & 0 deletions msg/Boxes.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Boxes.msg
#
# Box[] : boxes

# cev_msgs/Box[] boxes

cev_msgs/Box[] obstacles
Loading