Skip to content
Open
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
27 changes: 6 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
# height-map
<img src="images/image_53.png" alt="height map" width="400px"></img>
# BEV images generator

Currently, this ROS workspace processes LIDAR data to create PNG "bird's eye" height maps for use in deep learning applications. All of the real code currently resides in ```/ros-examples/src/lidar/src/lidar_node.cpp```.
## Brief overview
This repository is based on the original one by MacAllister Higgins (https://github.com/mjshiggins/ros-examples) ,but provides HSR colorization of the PointCloud or code the encoding with height, density and intensity (Colour visualisation corresponds to the LiDAR values)

To use this node, first build. You'll need OpenCV dependencies, but that should be included in ROS. If you want to save the images, create a folder in the ROS root workspace (where this readme is located) called ```images```. Everything will automatically be saved there.
add images here...

To run: ```rosrun lidar lidar_node```

You should see an image window pop up. The point cloud topic is hard coded in lidar_node.cpp. You may need to change that to ```/points_raw```. After this node is up, play your bag file.

# ros-examples
Want to learn how to use the Robot Operating System (ROS), the Point Cloud Library (PCL), and a bunch of other cool tools to make a self-driving car or other awesome robot? This repository is home to a collection of ROS nodes that process 3D sensor information, specifically as examples for the Udacity/Didi $100k object detection challenge. Learn about obstacle fusion techniques, and use these nodes as a starting point for building your own awesome obstacle detection engine!

For more info, check out the main competition site [here](https://www.udacity.com/didi-challenge).

If you have any issues, create a pull request! I'd love to add your contributions to this repo. Alternatively, shoot me a tweet at [macjshiggins](https://twitter.com/macjshiggins).

# setup
This is a standard ROS catkin-ized workspace. Don't know what that means? Check out a great intro on ROS [here](http://wiki.ros.org/ROS/Tutorials) or head on over to [Udacity](http://udacity.com) to sign up for the Robotics or Self-Driving Car Engineer Nanodegree.

There's currently only one node for processing LIDAR data. Use "catkin_make" in the root of this repo to build the lidar node, and run with ```rosrun lidar lidar_node``` after installing PCL and ROS (Indigo, preferably).

If you've downloaded any of the datasets for the challenge, you can start using the data with these nodes immediately by running ```rosbag play -l name-of-file.bag```. The "-l" keeps the bag file playing on repeat so that you can keep working on your algorithm without having to mess with the data playback.
# Setup
to be continued...
9 changes: 5 additions & 4 deletions src/lidar/src/lidar_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
#include <pcl/io/pcd_io.h>

#include <cv_bridge/cv_bridge.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/highgui/highgui_c.h>

#include <ros/ros.h>
#include <ros/console.h>
Expand Down Expand Up @@ -171,14 +172,14 @@ int main(int argc, char** argv)
// Setup image
cv::Mat map(IMAGE_HEIGHT, IMAGE_WIDTH, CV_8UC3, cv::Scalar(0, 0, 0));
heightmap = &map;
cvNamedWindow("Height Map", CV_WINDOW_AUTOSIZE);
cvNamedWindow("Height Map", WINDOW_AUTOSIZE);
cvStartWindowThread();
cv::imshow("Height Map", *heightmap);

// Setup Image Output Parameters
fnameCounter = 0;
lowest = FLT_MAX;
compression_params.push_back(CV_IMWRITE_PNG_COMPRESSION);
compression_params.push_back(IMWRITE_PNG_COMPRESSION);
compression_params.push_back(9);

// Setup indicies in point clouds
Expand Down