Resoluation du problème de référence

This commit is contained in:
Unknown 2018-08-03 12:32:42 +02:00
parent d8929a1eac
commit 3a7050eb53
20 changed files with 57683 additions and 19542 deletions

View file

@ -29,8 +29,11 @@ find_package(catkin REQUIRED COMPONENTS
pcl_ros
sensor_msgs
)
#find_package(Eigen3 REQUIRED)
#find_package(cmake_modules 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()
## Compile as C++11, supported in ROS Kinetic and newer
#add_compile_options(-std=c++11)

View file

@ -132,9 +132,9 @@ target_link_libraries(ASIFT_matcher
X11
)
add_custom_command(TARGET ASIFT_matcher PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/book_training $<TARGET_FILE_DIR:ASIFT_matcher>)
#add_custom_command(TARGET ASIFT_matcher PRE_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy_directory
# ${CMAKE_SOURCE_DIR}/book_training $<TARGET_FILE_DIR:ASIFT_matcher>)
## Add cmake target dependencies of the executable
## same as for the library above

View file

@ -0,0 +1,12 @@
<launch>
<param name="reference_txt_path" value="$(find asift_matching)/reference_data/references.txt"/>
<!--rosparam param="reference_data">[
"$(find asift_matching)/reference_data/train_image_000.png",
"$(find asift_matching)/reference_data/train_image_001.png"]</rosparam-->
<param name="object_center_topic" value="/object_center"/>
<param name="image_topic" value="/camera/rgb/image_raw"/>
<param name="pointcloud_topic" value="/camera/depth_registered/points"/>
<node name="ASIFT_matching" pkg="asift_matching" type="ASIFT_matcher" output="screen"/>
</launch>

View file

@ -0,0 +1,12 @@
<launch>
<param name="reference_txt_path" value="$(find asift_matching)/reference_data/references.txt"/>
<rosparam param="reference_data">[
"$(find asift_matching)/reference_data/train_image_000.png",
"$(find asift_matching)/reference_data/train_image_001.png"]</rosparam>
<param name="object_center_topic" value="/object_center"/>
<param name="image_topic" value="/camera/rgb/image_raw"/>
<param name="pointcloud_topic" value="/camera/depth_registered/points"/>
<node name="ASIFT_matching" pkg="asift_matching" type="ASIFT_matcher" output="screen"/>
</launch>

View file

@ -7,7 +7,7 @@
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="blue@todo.todo">blue</maintainer>
<maintainer email="antoineharle@etu.upmc.fr">Antoine Harle</maintainer>
<!-- One license tag required, multiple allowed, one license per tag -->

View file

@ -56,19 +56,13 @@
<build_depend>pcl_conversions</build_depend>
<build_depend>pcl_ros</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_export_depend>pcl_conversions</build_export_depend>
<build_export_depend>pcl_ros</build_export_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>sensor_msgs</build_export_depend>
<exec_depend>pcl_conversions</exec_depend>
<exec_depend>pcl_ros</exec_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<build_depend>libpcl-all-dev</build_depend>
<exec_depend>libpcl-all</exec_depend>
<run_depend>libpcl-all</run_depend>
<run_depend>pcl_conversions</run_depend>
<run_depend>pcl_ros</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>tf</run_depend>
<!--run_depend>message_runtime</run_depend-->

File diff suppressed because it is too large Load diff

View file

Before

Width:  |  Height:  |  Size: 522 KiB

After

Width:  |  Height:  |  Size: 522 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 552 KiB

After

Width:  |  Height:  |  Size: 552 KiB

Before After
Before After

17
asift_match/setup.py Normal file
View file

@ -0,0 +1,17 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['asift_matching'],
package_dir={'': 'src'},
)
setup(**setup_args)

17
asift_match/setup.py~ Normal file
View file

@ -0,0 +1,17 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['babbling_modules_emulator'],
package_dir={'': 'src'},
)
setup(**setup_args)

View file

@ -1,26 +1,43 @@
#include "ROS_matcher.hpp"
ROS_matcher::ROS_matcher(): _num_tilt(8), _status(MATCHER_STATUS_IDLE)
ROS_matcher::ROS_matcher(): _num_tilt(8), _status(MATCHER_STATUS_WAITING_INIT)
{
// _center_pub = _nh.advertise<geometry_msgs::PointStamped>("/ROS_matcher/center", 10);
_center_pub = _nh.advertise<rviz_interface::NamedPoint>("/object_center", 1);
std::string center_topic, image_topic, pointcloud_topic, reference_txt_path;
std::vector<std::string> reference_data_paths;
info_sub = new message_filters::Subscriber<sensor_msgs::CameraInfo>(_nh, "/camera/rgb/camera_info", 1);
image_sub = new message_filters::Subscriber<sensor_msgs::Image>(_nh, "/camera/rgb/image_raw", 1);
pointcloud_sub= new message_filters::Subscriber<sensor_msgs::PointCloud2>(_nh, "/camera/depth_registered/points", 1);
_nh.param<std::string>("object_center_topic", center_topic,"/ASIFT_matcher/object_center");
_nh.param<std::string>("image_topic", image_topic,"/camera/rgb/image_raw");
_nh.param<std::string>("pointcloud_topic", pointcloud_topic,"/camera/depth_registered/points");
_center_pub = _nh.advertise<rviz_interface::NamedPoint>(center_topic, 1);
info_sub = new message_filters::Subscriber<sensor_msgs::CameraInfo>(_nh, "camera/rgb/camera_info", 1);
image_sub = new message_filters::Subscriber<sensor_msgs::Image>(_nh, image_topic, 1);
pointcloud_sub= new message_filters::Subscriber<sensor_msgs::PointCloud2>(_nh, pointcloud_topic, 1);
Timesync = new message_filters::Synchronizer<MySyncPolicy>(MySyncPolicy(10),*info_sub, *image_sub, *pointcloud_sub);
Timesync-> registerCallback(boost::bind(&ROS_matcher::cameraCallback, this, _1, _2, _3));
// unsigned int nb_ref =2;
// std::string refData[] = {
// "train_image_000.png",
// "train_image_001.png"};
if(_nh.getParam("reference_txt_path", reference_txt_path))
{
if(matcher.loadReferences(reference_txt_path.c_str()))
_status = MATCHER_STATUS_IDLE;
}
else if(_nh.getParam("reference_data", reference_data_paths))
{
for(unsigned int i=0; i<reference_data_paths.size(); i++)
matcher.addReference(reference_data_paths[i].c_str(),_num_tilt);
if(matcher.getNbRef()>0)
_status = MATCHER_STATUS_IDLE;
}
else
{
ROS_WARN("No reference data to initialize matcher.");
}
// for(unsigned int i=0; i<nb_ref;i++)
// {
// matcher.addReference(refData[i].c_str(), _num_tilt);
// }
ROS_INFO("Matcher Ready !");
if(_status == MATCHER_STATUS_IDLE)
ROS_INFO("Matcher Ready ! (%d references)",matcher.getNbRef());
}
ROS_matcher::~ROS_matcher()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 KiB