Coder Social home page Coder Social logo

kostaskonkk / datmo Goto Github PK

View Code? Open in Web Editor NEW
300.0 6.0 77.0 49.45 MB

Detection and Tracking of Moving Objects (DATMO) using sensor_msgs/Lidar.

License: BSD 2-Clause "Simplified" License

CMake 1.82% C++ 97.58% Dockerfile 0.60%
lidar ros autonomous-vehicles clustering data-association detection obstacle-avoidance datmo rectangle-fitting

datmo's Introduction

Detection and Tracking of Moving Objects with 2D LIDAR

This package aims to provide Detection and Tracking of Moving Objects capabilities to robotic platforms that are equipped with a 2D LIDAR sensor and publish 'sensor_msgs/LaseScan' ROS messages. Such a scenario would be the one visualized below, in which the black scaled car is equipped with a LIDAR sensor and it needs to track the motion of the red vehicle through the LIDAR measurements.
Example experiment

The output of this package is visualized below and it can be observed that it estimates position, velocity, orientation and dimensions of the red vehicle.
Example experiment

It specializes in tracking of rectangle shaped objects and therefore it is most used in vehicle tracking. The workflow of this package is inspired by the one presented in Kim et al., 2018 [1].

Overview

Below you can read a synopsis of its funcion and operation. A more in depth explanation of this package's inner workings is given in this paper.

Detection

The detection part of the system is visualized in the following flowchart: Visualization of the detection stage

Clustering

In the clustering step the raw LIDAR measurements are divided to groups/clusters. In this way, the different objects in the environment are differentiatted. A simple way to do this is by separating clusters, based on the inbetween euclidean distance of LIDAR measurements. Therefore, if the distance of two consequtive LIDAR measurements is greater than a predefined threshold distance the two points are divided in two separate clusters. Visualization of the breakpoint clustering algorithm However, since LIDAR measurements become less dense as the distance from the sensor increases, objects For this reason, the threshold distance should be adapted in a way that it increses in relation with the range distance. In this system, this is achieved by using the Adaptive Breakpoint Detector algorithm. Its operation is visualized in the right side of the above figure and the equation that it uses is given below it.

Rectangle Fitting and L-shape extraction

In this step, rectangles are fitted onto the extracted clusters are fitted with rectangles. This is done to increase the tracking accuracy and shape estimation of rectangular objects. The algorithm used for rectangle fitting is the Search-Based Rectangle Fitting algorithm developed by Zhang et al., 2017 [2]. Rectangle Fitting After rectangle fitting, L-shapes are extracted from all the rectangles. L-shapes represent the corner of the rectangle closer to the sensor and its two adjacent sides. Therefore, every L-shape contains five measurements, the position of the corner point, the orientation of the rectangle (theta) and the length of its sides (L1, L2).

Tracking

The tracking part of the system is visualized in the following flowchart: Visualization of the tracking stage

Data Association

The clusters are tracked between time frames by a Nearest Neighbour data association scheme, with a Euclidean distance criterion.
Visualization of the association algorithm

Apperance Change Detector

In cases that the closest corner point of a tracked vehicle changes between measurements, this is detected by comparing the Mahalanobis distance of the four corner points of the vehicle with that of the new L-shape. Visualization of the corner switching scheme

Kinematic and Shape Trackers

The motion of the detected vehicles is tracked based on two kinematic trackers. A Kalman Filter with a Constant Velocity Model and an Unscented Kalman Filter with a Coordinated-Turn model. Kinematic Trackers

The shape and orientation of the detected vehicles are tracked by a Kalman Filter that contains two models. The first model is a Constant Shape model and it indicates that the shape of the detected vehicle remains constant. The second model is a Constant Turn Rate model that indicates that the turn rate of the detected vehicle remains constant, while its orientation depends on the turn rate. Kinematic Trackers

Below you can find a video presentation in which some early features of this package are explained.

Midterm presentation

Installation and use

This ROS package can be installed in the following ways:

Installation from ROS repositories

If you have ROS melodic installed you can install via:

sudo apt install ros-melodic-datmo

##Installation from source

  1. First you should navigate to the source folder of your catkin_ws. For example cd ~/catkin_ws/src.
  2. Run
git clone [email protected]:kostaskonkk/datmo.git
cd ..
catkin_make

The datmo package should be now installed to your computer and you will be able to use it after sourcing your workspace.

source devel/setup.bash

You can run a demonstration of the DATMO package by running:

roslaunch datmo example.launch bag:=overtakes

You can run it by typing:

roslaunch datmo datmo.launch

ROS API

Subscribed Topics

scan(sensor_msgs/LaserScan) - This topic should be created be your LIDAR sensor.

Published Topics

This node can publish a variety of topics but the final configuration depends on the user. By default the majority of the topics are disabled and they should be enabled through the launch file configuration.

datmo/marker_array (visualization_msgs/MarkerArray) - In this topic a variety of Rviz markers are published, which can facilitate in understanding the inner workings of the program.
datmo/box_kf (datmo/TrackArray) - In this topic the output of a Kalman Filter with a Constant Velocity model, which tracks the center of the box that surrounds the clusters is published.\

Note: In case that the marker_array topic is published from a robot and visualized in a computer which has a different version of ROS installed (kinetic, melodic, ...), the msgs will not be published and the datmo node will crash with an md5sum error. To fix this error, you should install on your robot the visualization msgs package of the ROS installation that runs on your computer.

Custom Messages

This package uses two custom msgs types datmo/Track and datmo/TrackArray to facilitate the publishing of its results. To my knowledge, at the time of developement, there was no standard ROS messages that accomplishes the same task.

The datmo/Track message has the following structure:
int32 id - object ID, so it is possible to differentiate between different objects during tracking
float32 length - Estimated length of the object
float32 width Estimated width of the object
nav_msgs/Odometry odom - Estimated pose of the object

The datmo/TrackArray message is an array that contains multiple datmo/Track messages, with the goal of efficient publishing.

Rviz markers

In case that the pub_markers flag is set to true, this package publishes visualization messages, which can be displayed in Rviz. The following messages are published:

closest_corner - The closest corner point of surrounding vehicles is visualized with a black rectangle.
bounding_box_center - The center of the bounding box is visualized with a yellow rectangle.
velocities - The velocities of the tracked objects are represented with an arrow.\

Parameters

  • "lidar_frame" ("string", default: "laser") - Name of the transformation frame (frame_id) of the LaserScan msgs
  • "world_frame" ("string", default: "world") - Name of the world coordinate frame, if it is not available, this value can be set equal to the lidar_frame
  • "threshold_distance" ("double", default: "0.2") - This value sets the distance that is used by the clustering algorithm
  • "euclidean_distance" ("double", default: "0.25") - This value sets the distance that is used by the euclidean distasnce data association algorithm
  • "pub_markers" ("bool", default: "false") - publish of the the vizualization markers

Used by

If you use this package or find it useful in your research feel free to add your project in this list:

  1. Fast and Safe Trajectory Optimization for Autonomous Mobile Robots Using Reachability Analysis. 2021. Vaskov, Sean. PhD Thesis.

References

[1] D. Kim, K. Jo, M. Lee, and M. Sunwoo, “L-shape model switching-based precise motion tracking of moving vehicles using laser scanners,” IEEE Transactions on Intelligent Transportation Systems, vol. 19, no. 2, pp. 598–612, 2018.
[2] X. Zhang, W. Xu, C. Dong, and J. M. Dolan, “Efficient l-shape fitting for vehicle detection using laser scanners,” in 2017 IEEE Intelligent Vehicles Symposium (IV), pp. 54–59, IEEE, 2017.

datmo's People

Contributors

kostaskonkk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

datmo's Issues

Run package in our dataset

Hi, @kostaskonkk thanks for your hard work.
I'm interested in your results, so I want to test it in my dataset.

In case, my bag's details are as below.
Screenshot from 2023-05-19 15-19-38
Also frame_id is "laser_multi".
And I had modified some parameter in "example.launch" file for my case.
Screenshot from 2023-05-19 15-47-07

After that I ran it in terminal like this:

"~$ roslaunch datmo example.launch bag=:dataset_ntf"

And this is capture of result in rviz.
Screenshot from 2023-05-19 15-54-54
I think, the datmo package does not subscribe our scan data.
So, my question is, what am I missing part to run your code?

Example files do not work like the videos in README

Hello kostaskonkk,

I was interested in your package
But after installing and running it according to the README
I found out that it doesn't work
I have run "roslaunch ydlidar lidar.launch"

And,
I ran "roslaunch datmo example.launch bag:=overtakes"
the attach file is :
datmo example rosnode

datmo example rostopic

datmo example tf

example frames (1).pdf

I ran " roslaunch datmo datmo.launch "
the attach file is :
datmo datmo rosnode

datmo datmo rostopic

datmo datmo tf

datmo frames (1).pdf

my OS is Ubuntu 18.04, ROS version is Melodic.

Thank you,
DEPhantom

how to debug this project by vscode?

i am so sorry, when i use vscode to dubug this project:

  1. i use rosplay to run overtakes.bag, and bebug the executable file of datmo,

  2. but in function callback() it always remind me of "No transform could be found between base_link and map"

so my question is how can i debug this project, thanks a lot! looking forward your reply!

if (tf_listener.canTransform(world_frame, lidar_frame, ros::Time())) // during debug failed to entering the code in if

No objects and no namespace options under marker_array

Hello Kostas, awesome work.
I managed to start the launch file, everything seems to work. Also with the rqt_graph /datmo seems to listen to my /scan message and publish /marker_array, except the /link_laser. But with rviz I can't find anything under MarkerArray and the submenu Namespace, no objects are recognized, unlike your demo. Do you know what I am missing for objects to be recognized? As another launch file I only use the one from RpLidar A1 for the /scan.

rviz_screenshot_2020_03_21-12_43_10

How to track the object you want by ID?

Thank you for your sharing! But I have a simple question.
If I want to just track one object like a car, how can I know the object ID which represents the car in the array? (In TrackArray there are so many object...)

about 'tf2_geometry_msgs/tf2_geometry_msgs.h'

Hello. I have a question about error.

If i do 'catkin_make' after git cloning in basic tutorial
image
here are some these errors.

Honestly, i used it on docker. But other is always good.
But these error occurs. Is it okay?

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.