Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fercabe committed Nov 19, 2020
1 parent 8b65231 commit 0f0523d
Show file tree
Hide file tree
Showing 10 changed files with 1,667 additions and 2 deletions.
170 changes: 170 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
cmake_minimum_required(VERSION 2.8.3)
project(dll)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
set(CMAKE_CXX_STANDARD 11)
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
tf
geometry_msgs
pcl_conversions
pcl_ros
octomap_ros
nav_msgs
)

# Ceres solver
find_package(Ceres REQUIRED)

## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependencies might have been
## pulled in transitively but can be declared for certainty nonetheless:
## * add a build_depend tag for "message_generation"
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )

## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# std_msgs
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES stereo_processing
# CATKIN_DEPENDS roscpp rospy std_msgs
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
)

## Declare a cpp executable
add_executable(dll_node src/dll_node.cpp)
add_executable(grid3d_node src/grid3d_node.cpp)

## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
add_dependencies(dll_node ${catkin_EXPORTED_TARGETS})
add_dependencies(grid3d_node ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
target_link_libraries(dll_node
${catkin_LIBRARIES}
${CERES_LIBRARIES}
)
target_link_libraries(grid3d_node
${catkin_LIBRARIES}
)

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS stereo_processing stereo_processing_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_stereo_processing.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# dll
DLL: Direct Lidar Localization
# DLL: Direct Lidar Localization

Robot localization based on direct registration of 3D LIDAR on maps.

## Dependencies

- ceres: Follow in installation instructions for Google Ceres
67 changes: 67 additions & 0 deletions launch/dll.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!--
-->
<launch>
# Bag filename
<arg name="bag_file" />

# Use simulation time for TFs
<param name="use_sim_time" value="true" />

# Bag file
<node name="bag_player" type="play" pkg="rosbag" args="$(arg bag_file) --clock -s 0 -r 1.0 -l" />

# Frames
<include file="$(find nix_launchers)/launch/frames.launch" />

<arg name="base_frame_id" default="base_link"/>
<arg name="odom_frame_id" default="odom"/>
<arg name="global_frame_id" default="map"/>

# marsella_mapping_2019.bag
<arg name="initial_x" default="6.7"/>
<arg name="initial_y" default="14"/>
<arg name="initial_z" default="0"/>
<arg name="initial_a" default="0.18"/>
<arg name="map" default="marsella_5cm_full.bt" />

# 2020-06-25-15-10-43_0.bag
<!--arg name="initial_x" default="6.23"/>
<arg name="initial_y" default="11.9"/>
<arg name="initial_z" default="0"/>
<arg name="initial_a" default="-1.54"/>
<arg name="map" default="basement_2.bt"/-->

# Odom to TF
<!--node pkg="odom_to_tf" type="odom_to_tf.py" name="odom_to_tf">
<param name="laser_frame" value="base_link"/>
<param name="rotate_90" value="false"/>
</node-->

# Launch DLL
<node name="dll_node" type="dll_node" pkg="dll" output="screen">
<remap from="/dll_node/initial_pose" to="/initialpose"/>
<param name="in_cloud" value="/os1_cloud_node/points_non_dense" />
<param name="base_frame_id" value="$(arg base_frame_id)" />
<param name="odom_frame_id" value="$(arg odom_frame_id)" />
<param name="global_frame_id" value="$(arg global_frame_id)" />

<param name="rate" value="10.0" />
<param name="map_path" value="$(find dll)/launch/$(arg map)" />
<param name="sensor_dev" value="0.02" />
<param name="publish_point_cloud" value="true" />
<param name="update_min_d" value="0.1" />
<param name="update_min_a" value="0.1" />
<param name="initial_x" value="$(arg initial_x)"/>
<param name="initial_y" value="$(arg initial_y)"/>
<param name="initial_z" value="$(arg initial_z)"/>
<param name="initial_a" value="$(arg initial_a)"/>
<param name="lidar_width" value="1024" />
<param name="lidar_height" value="16" />
<param name="lidar_fov" value="0.7854" />
<param name="m_lidar_fov_down" value="0.3927" />
<param name="use_imu" value="false" />

</node>

<node name="rviz" type="rviz" pkg="rviz" output="screen"/>
</launch>
68 changes: 68 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0"?>
<package>
<name>dll</name>
<version>1.0.0</version>
<description>Direct Lidar Localization (DLL)</description>

<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="[email protected]">Jane Doe</maintainer> -->
<maintainer email="[email protected]">Fernando Caballero</maintainer>


<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>TODO</license>


<!-- Url tags are optional, but mutiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/stereo_processing</url> -->


<!-- Author tags are optional, mutiple are allowed, one per tag -->
<!-- Authors do not have to be maintianers, but could be -->
<!-- Example: -->
<!-- <author email="[email protected]">Jane Doe</author> -->


<!-- The *_depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use run_depend for packages you need at runtime: -->
<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>tf</build_depend>
<build_depend>libpcl-all-dev</build_depend>
<build_depend>octomap</build_depend>
<build_depend>octomap_ros</build_depend>
<build_depend>pcl_ros</build_depend>
<run_depend>pcl_ros</run_depend>
<run_depend>octomap</run_depend>
<run_depend>octomap_ros</run_depend>
<run_depend>libpcl-all</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>nav_msgs</run_depend>
<run_depend>tf</run_depend>



<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->

</export>
</package>
21 changes: 21 additions & 0 deletions src/dll_node.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <ros/ros.h>
#include <string>
#include "dllnode.hpp"

int main(int argc, char **argv)
{
ros::init(argc, argv, "dll_node");

// Particle filter instance
std::string node_name = "dll_node";
DLLNode node(node_name);

// Process data at given rate
ros::spin();

return 0;
}




Loading

0 comments on commit 0f0523d

Please sign in to comment.