Skip to content

Commit

Permalink
Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andyblarblar committed Nov 12, 2023
1 parent 018ef81 commit 34ab6ba
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 49 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(phnx_msgs REQUIRED)
find_package(OpenCV 4.2.0 REQUIRED)
find_package(visualization_msgs REQUIRED)

Expand All @@ -27,7 +26,6 @@ set(dependencies
rclcpp
geometry_msgs
nav_msgs
phnx_msgs
OpenCV
visualization_msgs
)
Expand Down
85 changes: 38 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,38 @@
An opinionated ROS2 C++ node template, optimised for ISC.

# Instructions

1. Clone repo inside your workspaces src directory (Ex. phnx_ws/src)
2. `rosdep install --from-paths . --ignore-src -r -y` to install deps
3. `colcon build` to make sure the repo builds before you mess with it
4. Replace the following in both file names and code exactly and consistently.
1. obj_tracker: Replace with the package name. Use snake case. Ex. `data_logger`
2. ObjTrackerNode: Replace with the node name. Use Pascal case. Ex. `DataLogger`
5. `colcon build` again. If it builds, you are done
6. Rename outer folder
7. Review the optional dependencies, and remove what you do not need

# Dependencies
Some common extra dependencies are included. Review them and remove what you don't need.
These are marked with TODO_EXTRA.

# Features

- Unit tests
- ROS-Industrial github CI (will test units and lints)
- C++ formatting via clangformat
- A selection of sane lints
- A single node setup in a multithreaded executor

# File structure

```
.
├── include
│   └── obj_tracker
│   └── ObjTrackerNode_node.hpp
├── package.xml
├── README.md
├── src
│   ├── ObjTrackerNode.cpp
│   └── ObjTrackerNode_node.cpp
└── tests
└── unit.cpp
```

ObjTrackerNode_node: Source files for the ROS2 node object itself, and only itself

ObjTrackerNode.cpp: Source for the main function of the node, and only the main function

tests/unit.cpp: Example file for unit tests. This is linked to the node and ros, so both can be used
# obj_tracker
From package '[obj_tracker](https://github.com/ISC-Project-Phoenix/obj_tracker)'
# File
`./src/ObjTrackerNode.cpp`

## Summary
Generic Multiple Object Tracker (MOT) node for ROS2. Obj_tracker tracks PoseArrays over time, both smoothing the pose
and maintaining indentity. It does this by predicting with Kalman filters, then associating tracks with detections
by solving the resulting assignment problem.

## Topics

### Publishes
- `/tracks`: Array of Filtered poses

### Subscribes
- `/object_poses`: Array of Poses to filter

## Params
- `max_frames_missed`: Number of updates a tracker is allowed to predict without being matched to a detection.
Smaller numbers will be vulerable to flaky detections, larger values can stick around too long after detection leaves.
- `max_dist`: Max distince in meters allowed between a track and detection before they are considered to not be associated.
This will need to be larger for data with high amplitude in its noise, but that risks swapping tracks between detections.

- `prediction_cov`: Scalar used for the diagonal of the prediction covarience matrix of the kalman filters. Lower values weight the filter
more towards predictions.

- `measure_cov`: Scalar used for the diagonal of the measurement covarience matrix of the kalman filters. Lower values weight the filter
more towards measurements.

- `inital_vx`: Scalar used for the inital x velocity state in the kalman filters. Use this to bias the filters inital predictions to
follow object motion if you are moving forward or backwards.

- `test_latency`: Outputs the latency of the node as logs if true.

- `visualize_ids`: Publishes id markers in rviz if true.


70 changes: 70 additions & 0 deletions obj_tracker.doctor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#ROS package you are documenting
package_name = "obj_tracker"
repo = "https://github.com/ISC-Project-Phoenix/obj_tracker"

#You can have multiple nodes in one package
[[nodes]]
node_name = 'obj_tracker'
#Relitive to this file
source_file = ['./src/ObjTrackerNode.cpp']
summary = '''
Generic Multiple Object Tracker (MOT) node for ROS2. Obj_tracker tracks PoseArrays over time, both smoothing the pose
and maintaining indentity. It does this by predicting with Kalman filters, then associating tracks with detections
by solving the resulting assignment problem.
'''

#Your published topics (optional)
[[nodes.publishes]]
name = '/tracks'
description = 'Array of Filtered poses'

#Your subscribed topics (optional)
[[nodes.subscribes]]
name = '/object_poses'
description = 'Array of Poses to filter'

#Your node parameters (optional)
[[nodes.params]]
name = 'max_frames_missed'
description = '''Number of updates a tracker is allowed to predict without being matched to a detection.
Smaller numbers will be vulerable to flaky detections, larger values can stick around too long after detection leaves.'''

[[nodes.params]]
name = 'max_dist'
description = '''
Max distince in meters allowed between a track and detection before they are considered to not be associated.
This will need to be larger for data with high amplitude in its noise, but that risks swapping tracks between detections.
'''

[[nodes.params]]
name = 'prediction_cov'
description = '''
Scalar used for the diagonal of the prediction covarience matrix of the kalman filters. Lower values weight the filter
more towards predictions.
'''

[[nodes.params]]
name = 'measure_cov'
description = '''
Scalar used for the diagonal of the measurement covarience matrix of the kalman filters. Lower values weight the filter
more towards measurements.
'''

[[nodes.params]]
name = 'inital_vx'
description = '''
Scalar used for the inital x velocity state in the kalman filters. Use this to bias the filters inital predictions to
follow object motion if you are moving forward or backwards.
'''

[[nodes.params]]
name = 'test_latency'
description = '''
Outputs the latency of the node as logs if true.
'''

[[nodes.params]]
name = 'visualize_ids'
description = '''
Publishes id markers in rviz if true.
'''

0 comments on commit 34ab6ba

Please sign in to comment.