ros-perception / laser_geometry Goto Github PK
View Code? Open in Web Editor NEWProvides the LaserProjection class for turning laser scan data into point clouds.
License: BSD 3-Clause "New" or "Revised" License
Provides the LaserProjection class for turning laser scan data into point clouds.
License: BSD 3-Clause "New" or "Revised" License
--- stderr: laser_geometry
CMake Error at CMakeLists.txt:14 (find_package):
By not providing "Findeigen3_cmake_module.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"eigen3_cmake_module", but CMake did not find one.
Could not find a package configuration file provided by
"eigen3_cmake_module" with any of the following names:
eigen3_cmake_moduleConfig.cmake
eigen3_cmake_module-config.cmake
Add the installation prefix of "eigen3_cmake_module" to CMAKE_PREFIX_PATH
or set "eigen3_cmake_module_DIR" to a directory containing one of the above
files. If "eigen3_cmake_module" provides a separate development package or
SDK, be sure it has been installed.
---
Failed <<< laser_geometry [4.33s, exited with code 1]
After commit bfd47ec, colcon build fails due to eigen3_cmake_module
I think this error is occured from missing dependencies in package.xml
find_package(eigen3_cmake_module REQUIRED) needs to be added to ros-perception/laser_geometry/CMakeLists.txt for Dashing branch
It would be nice to have a LICENSE file in the top level of the ros2 branch (such as https://github.com/ros2/rviz/blob/ros2/LICENSE) in accordance with Github best practices.
All ROS2 branches do still include the Python wrapper, which start with importing rospy - so the Python part is still ROS1. I find it quite confusing to have a ROS2 package with non-working ROS1 code inside.
When trying to use the package, I got an include error that I fixed based on this similar error: opencv/opencv#14868
It's just a change to line 47 in laser_geometry.h:
#include <**eigen3**/Eigen/Core>
I am on ROS Noetic/Ubuntu 20.04. It doesn't look like there is a branch for noetic, but there is a ros-noetic-laser-geometry package that might be broken for others as well, so this might be a nice little fix if you have a moment. Alternatively, it might break others' setups - not too sure, sorry.
This package supports ros melodic and tf is deprecated in melodic. As i see in api reference, we can only use tf::Transformer with transformLaserScanToPointCloud(). How can we use tf2_ros::Buffer or tf2_ros::TransformListener with this function?
Hi,
I use this package for generating pointcloud corresponding to the laser range data. range
data is of float32
type where as PointCloud2
data is uint8
type and therefore it is confusing for me to interpret as to which range measurement corresponds to which data of the cloud.
Again, from the structure of the cloud
, I find that the sequence of data repeats after every 16 data field, in which last four remain zeros. The remaining 12 represent one point corresponding to a range measurement. Am I right? Now, I do not understand which ones are the x
, y
and z
values in this.
Please help me to interpret it correctly, as I need to do some sensor calibration using this data.
This bug was reported in rviz originally: ros-visualization/rviz#1541.
I suspect that the function transformLaserScanToPointCloud()
doesn't correctly handle the single ray scan?
what is wrong with that?
/home/g/fusion_ws/src/zed_hokuyo_fusion/src/zed_hokuyo_fusion.cpp:84:1: error: ‘laser_geomery’ does not name a type
laser_geomery::LaserProjection projector_;
^
I aready install ros-kinect-laser-geomery
#56 ups the cmake version for noetic. To keep all non-EOL branches of laser_geometry on the same branch, I'll change the release branch for kinetic and melodic to kinetic-devel and do a release.
Would you mind releasing laser_geometry
to ROS Noetic? It looks like all of its dependencies have been released, and recursively 121 repos need it.
I'm not sure how much work it will need. At a minimum it needs #56.
this 3 project package cannot build success together if use catkin_make ,default with -j4 option. I think it need to tidy up the cmake files.
For the last couple days, the test has been timing out on macOS nightly CI:
Example output:
06:31:12 5: [==========] Running 1 test from 1 test case.
06:31:12 5: [----------] Global test environment set-up.
06:31:12 5: [----------] 1 test from laser_geometry
06:31:12 5: [ RUN ] laser_geometry.projectLaser2
06:34:12 Test #5: projection_test ..................***Timeout 180.13 sec
I haven't seen similar failures for other platforms.
@jonbinney I'm going to go ahead and do the melodic release using the existing version. I hope you don't mind, but we can release a new version at anytime.
Hi,
I have an hokuyo lidar with me, output file of lidar gives me Sensor_msg/Laserscan topic withchi gives me 2D data. I want to convert it into 3D sensor_msg/PointCloud2 data using your package. To do thet i have to use transformLaserScanToPointCloud function. Can you please help me with this, how can i use it with my data so that i can get final bag file with sensor_msg/PointCloud2 topic.
Thank you
Error-free compilation of ROS2 packages that depend on laser_geometry (e.g. nav2_costmap_2d) while using different Eigen3 header paths during the compilation of laser_geometry compared to the compilation of the dependent package.
The Eigen3 header path is hard-coded through adding the Eigen3_INCLUDE_DIRS
path to target_include_directories() in the CMakeLists.txt file. This results in a CMake Error in case the Eigen3 header path is different compared to the compilation of laser_geometry, because the header path gets hard-coded into the install/laser_geometry/share/laser_geometry/cmake/laser_geometryExport.cmake
file.
Remove line 25 from the CMakeLists.txt in the rolling, jazzy and ros2 branches due to the given redundancy and backporting the updated CMakeLists.txt file to the humble and iron branches to resolve this issue for all active releases.
colcon build
install/laser_geometry/share/laser_geometry/cmake/laser_geometryExport.cmake
file if the hard-coded path /usr/include/eigen3
appears in the INTERFACE_INCLUDE_DIRECTORIES
statement.The path to the Eigen3 headers is currently specified by adding the Eigen3_INCLUDE_DIRS path in the target_include_directories() statement of the CMakeLists.txt file. By using the Eigen3_INCLUDE_DIRS path in target_include_directories(), this path is hard-coded in the install/laser_geometry/share/laser_geometry/cmake/laser_geometryExport.cmake
file:
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/laser_geometry;/usr/include/eigen3;${_IMPORT_PREFIX}/include"
If the code is executed on the build system or the path of the Eigen3 headers is identical to the build system, this problem does not occur. However, if you cross-compile with precompiled ROS2 packages, which in my case were generated by a Yocto build process, the hard-coded Eigen3 header path generates a compilation error because the laser_geometry package was compiled and installed with a different Eigen3 header path. The following error occurs:
CMake Error in CMakeLists.txt:
Imported target "laser_geometry::laser_geometry" includes non-existent path "<removed-build-host-path>/laser-geometry/2.4.0-2-r0/recipe-sysroot/usr/include/eigen3" in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not provide.
The problem occurred when I cross-compiled the nav2_costmap_2d package (which depends on this package) with ROS2 Humble and the corresponding Yocto SDK. I noticed that the Eigen3 header path is also hard-coded when I natively compile this package with ROS2 Humble or Rolling.
In addition, the Eigen3 headers are included twice in the Rolling, Jazzy and ros2 branches in the CMakeLists.txt file.
In the CMakeLists.txt file in line 25:
${Eigen3_INCLUDE_DIRS}
and by the if/else statement from line 31 onwards:
if(TARGET Eigen3::Eigen)
target_link_libraries(laser_geometry PUBLIC Eigen3::Eigen)
else()
target_include_directories(laser_geometry PUBLIC ${Eigen3_INCLUDE_DIRS})
endif()
Both statements can be removed separately without causing a compilation error. Therefore, I would assume that the statements are redundant to each other. The second statement from line 31 prevents the hardcoded path from being written in the laser_geometryExport.cmake file in case target_link_libraries(laser_geometry PUBLIC Eigen3::Eigen) can be used.
I assume that the Eigen3_INCLUDE_DIRS
path should not be hard-coded in laser_geometryExport.cmake as mentioned in the following issue of the libeigen repo: With CMake, import CMake as a target instead of setting the include directories.
To fix this, I would suggest removing line 25 from the CMakeLists.txt in the rolling, jazzy and ros2 branches due to the given redundancy and backporting the updated CMakeLists.txt file to the humble and iron branches to resolve this issue for all active releases.
I'll do this as soon as tf is released, since we need that first.
when building ros2 eloquent as a merge on OSX, I ran into conflicts with gtest.
The main problem comes from using a global include_directories
in the CMakeLists.txt
. This should be addressed with target_include_directories
as well as ament_target_dependencies
.
I'll open a PR for it soonish.
➭ colcon_build --merge --packages-select laser_geometry
Starting >>> laser_geometry
--- stderr: laser_geometry
In file included from /Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/src/gtest-all.cc:41:
In file included from /Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:135:
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest-internal-inl.h:171:19: error: use of undeclared identifier 'FLAGS_gtest_print_utf8'; did you mean 'FLAGS_gtest_print_time'?
print_utf8_ = GTEST_FLAG(print_utf8);
^~~~~~~~~~~~~~~~~~~~~~
FLAGS_gtest_print_time
/usr/local/include/gtest/internal/gtest-port.h:2504:27: note: expanded from macro 'GTEST_FLAG'
# define GTEST_FLAG(name) FLAGS_gtest_##name
^
<scratch space>:181:1: note: expanded from here
FLAGS_gtest_print_utf8
^
/usr/local/include/gtest/gtest.h:116:1: note: 'FLAGS_gtest_print_time' declared here
GTEST_DECLARE_bool_(print_time);
^
/usr/local/include/gtest/internal/gtest-port.h:2515:59: note: expanded from macro 'GTEST_DECLARE_bool_'
# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
^
/usr/local/include/gtest/internal/gtest-port.h:2504:27: note: expanded from macro 'GTEST_FLAG'
# define GTEST_FLAG(name) FLAGS_gtest_##name
^
<scratch space>:251:1: note: expanded from here
FLAGS_gtest_print_time
^
In file included from /Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/src/gtest-all.cc:41:
In file included from /Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:135:
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest-internal-inl.h:193:5: error: use of undeclared identifier 'FLAGS_gtest_print_utf8'; did you mean 'FLAGS_gtest_print_time'?
GTEST_FLAG(print_utf8) = print_utf8_;
^~~~~~~~~~~~~~~~~~~~~~
FLAGS_gtest_print_time
/usr/local/include/gtest/internal/gtest-port.h:2504:27: note: expanded from macro 'GTEST_FLAG'
# define GTEST_FLAG(name) FLAGS_gtest_##name
^
<scratch space>:199:1: note: expanded from here
FLAGS_gtest_print_utf8
^
/usr/local/include/gtest/gtest.h:116:1: note: 'FLAGS_gtest_print_time' declared here
GTEST_DECLARE_bool_(print_time);
^
/usr/local/include/gtest/internal/gtest-port.h:2515:59: note: expanded from macro 'GTEST_DECLARE_bool_'
# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
^
/usr/local/include/gtest/internal/gtest-port.h:2504:27: note: expanded from macro 'GTEST_FLAG'
# define GTEST_FLAG(name) FLAGS_gtest_##name
^
<scratch space>:251:1: note: expanded from here
FLAGS_gtest_print_time
^
In file included from /Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/src/gtest-all.cc:41:
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:276:17: error: no member named 'OutputFlagAlsoCheckEnvVar' in namespace 'testing::internal'
internal::OutputFlagAlsoCheckEnvVar().c_str()),
~~~~~~~~~~^
/usr/local/include/gtest/internal/gtest-port.h:2527:50: note: expanded from macro 'GTEST_DEFINE_string_'
GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
^~~~~~~~~~~
In file included from /Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/src/gtest-all.cc:41:
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:429:28: error: functions that differ only in their return type cannot be overloaded
::std::vector<std::string> GetArgvs() {
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/local/include/gtest/internal/gtest-port.h:1431:60: note: previous declaration is here
GTEST_API_ const ::std::vector<testing::internal::string>& GetArgvs();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
In file included from /Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/src/gtest-all.cc:41:
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:798:54: error: no member named 'skipped_test_count' in 'testing::TestCase'
return SumOverTestCaseList(test_cases_, &TestCase::skipped_test_count);
~~~~~~~~~~^
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2206:17: error: no member named 'skipped' in 'testing::TestPartResult'
return result.skipped();
~~~~~~ ^
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2210:18: error: out-of-line definition of 'Skipped' does not match any declaration in 'testing::TestResult'
bool TestResult::Skipped() const {
^~~~~~~
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2484:20: error: unknown type name 'AssertionException'
} catch (const AssertionException&) { // NOLINT
^
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2520:30: error: use of undeclared identifier 'IsSkipped'
if (!HasFatalFailure() && !IsSkipped()) {
^
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2546:12: error: out-of-line definition of 'IsSkipped' does not match any declaration in 'testing::Test'
bool Test::IsSkipped() {
^~~~~~~~~
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2700:42: error: call to non-static member function without an object argument
if (!Test::HasFatalFailure() && !Test::IsSkipped()) {
~~~~~~^~~~~~~~~
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2729:15: error: out-of-line definition of 'skipped_test_count' does not match any declaration in 'testing::TestCase'; did you mean 'failed_test_count'?
int TestCase::skipped_test_count() const {
^~~~~~~~~~~~~~~~~~
failed_test_count
/usr/local/include/gtest/gtest.h:817:7: note: 'failed_test_count' declared here
int failed_test_count() const;
^
In file included from /Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/src/gtest-all.cc:41:
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2730:35: error: use of undeclared identifier 'TestSkipped'; did you mean 'TestFailed'?
return CountIf(test_info_list_, TestSkipped);
^~~~~~~~~~~
TestFailed
/usr/local/include/gtest/gtest.h:899:15: note: 'TestFailed' declared here
static bool TestFailed(const TestInfo* test_info) {
^
In file included from /Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/src/gtest-all.cc:41:
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2883:26: error: no member named 'kSkip' in 'testing::TestPartResult'
case TestPartResult::kSkip:
~~~~~~~~~~~~~~~~^
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:2980:37: error: unknown type name 'GTestColor'
static const char* GetAnsiColorCode(GTestColor color) {
^
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:3033:20: error: unknown type name 'GTestColor'
void ColoredPrintf(GTestColor color, const char* fmt, ...) {
^
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:3043:53: error: use of undeclared identifier 'COLOR_DEFAULT'
const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
^
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:3144:19: error: use of undeclared identifier 'COLOR_YELLOW'
ColoredPrintf(COLOR_YELLOW,
^
/Users/karsten/workspace/ros2/ros2_eloquent/install/src/gtest_vendor/./src/gtest.cc:3150:19: error: use of undeclared identifier 'COLOR_YELLOW'
ColoredPrintf(COLOR_YELLOW,
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[1]: *** [gtest/CMakeFiles/gtest.dir/all] Error 2
make: *** [all] Error 2
---
Failed <<< laser_geometry [ Exited with code 2 ]
Summary: 0 packages finished [3.57s]
1 package failed: laser_geometry
1 package had stderr output: laser_geometry
✘ 11:38:55 ~/workspace/ros2/ros2_eloquent
➭ colcon_build --merge --packages-select laser_geometry
Starting >>> laser_geometry
--- stderr: laser_geometry
/Users/karsten/workspace/ros2/ros2_eloquent/src/ros-perception/laser_geometry/src/laser_geometry.cpp:31:10: fatal error: 'laser_geometry/laser_geometry.hpp' file not found
#include "laser_geometry/laser_geometry.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/laser_geometry.dir/src/laser_geometry.cpp.o] Error 1
make[1]: *** [CMakeFiles/laser_geometry.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
---
Failed <<< laser_geometry [ Exited with code 2 ]
Summary: 0 packages finished [5.66s]
1 package failed: laser_geometry
1 package had stderr output: laser_geometry
Hi,
When I use function projectLaser
and given the range_cutoff
as default value -1, the range_cutoff
will be set to scan_in.range_max
, and it will let the points with the max_range be discarded.
However, in the doc of sensor_msgs/LaserScan, it says:
float32[] ranges # range data [m] (Note: values < range_min or > range_max should be discarded)
I think the point that the range equals to max_range exactly should not be discarded.
Please release this package into ROS Jade as it is a blocking dependency of the navigation stack.
It looks like the noetic source entry for laser_geometry says to use the branch indigo-devel
, but the package.xml
on that branch depends on the Python 2 rosdep key python-numpy
Line 29 in 83c7988
It should use the rosdep key python3-numpy
in Noetic
instead.
Hey,
i have a problem using "transformLaserScanToPointCloud" on ROS2 Foxy. I tried the deb package and also a self-compiled version of the foxy branch. The problem is that everytime my node wants to use the function it crashes without any message (even when i used a try-catch block).
I was able to hunt it down to line 68 in laser_geometry.cpp where the rows()
function of eigen3 always crashes with a segment fault exception. I already tried to initlize the ArrayXXd before using rows() but it doesn't help.
I'm not sure if this is a bug (maybe in the eigen3 lib) or if i am doing something wrong with the parameters. Not a C++ Dev, so not pretty sure about all the pointer/address stuff.
If it is helpful:
Ubuntu 20.04 as VMware VM (6 Cores, 16GB RAM)
Windows 10 1909 as Host (8 Cores, 32GB RAM)
laser_geometry.cpp Line 68:
if (co_sine_map_.rows() != static_cast<int>(n_pts) || angle_min_ != scan_in.angle_min || angle_max_ != scan_in.angle_max)
my code
void ScanMerger::scan_callback(const sensor_msgs::msg::LaserScan::SharedPtr msg) const
{
// waiting for transform
std::string transform_error;
if (tf_buffer_->canTransform(
pointcloud_frame_,
msg->header.frame_id,
tf2_ros::fromMsg(msg->header.stamp) + tf2::durationFromSec(msg->ranges.size()*msg->time_increment),
tf2::durationFromSec(0.1),
&transform_error)
)
{
// transform to pointcloud2
sensor_msgs::msg::PointCloud2 cloud;
auto target_frame = pointcloud_frame_.empty() ? msg->header.frame_id : pointcloud_frame_;
projector_->transformLaserScanToPointCloud(target_frame, *msg, cloud, *tf_buffer_);
// publish
pointcloud_publisher_->publish(cloud);
}
else
{
RCLCPP_ERROR(get_logger(), "Could not transform message: %s", transform_error.c_str());
}
}
The CMakeLists.txt contains
find_package(catkin REQUIRED
COMPONENTS
angles
roscpp
sensor_msgs
tf
tf2
tf2_geometry_msgs
)
But tf2_geometry_msgs is not declared as dependency in package.xml
Is support for PointCloud1 still needed even though PointCloud1 is deprecated?
In the first migration to ROS2 only the support for PointCloud2 is kept. If the PointCloud1 code is nonetheless needed in the future, it must be reintegrated.
Regarding this ticket. http://answers.ros.org/question/44140/fatal-error-eigencore-no-such-file-or-directory/
http://jenkins.ros.org/view/HbinP32/job/ros-hydro-laser-assembler_binarydeb_precise_i386/32/console
In file included from /tmp/buildd/ros-hydro-laser-assembler-1.7.1-0precise-20130916-0620/src/laser_scan_assembler.cpp:36:0:
/opt/ros/hydro/include/laser_geometry/laser_geometry.h:46:22: fatal error: Eigen/Core: No such file or directory
I wirte a laserscanSub callback function which is used to process the laser scan.But when I try to projectroLaser the sensor_msgs::LaserScan to sensor_msgs::PointCloud, I get the result: Segmentation fault(core dumped).The code is as below:
void Scanprocess::laserscanSubCallback(const sensor_msgs::LaserScanConstPtr &msg)
{
if (msg == NULL)
{
ROS_INFO("msg is a nullptr.");
return;
}
std::cout << msg << std::endl;
projector_->projectLaser(*msg, cloud_in_scan_);
}
I find the reason is :aborting core dump writing, size exceeds current limit 1048576.The address of msg is bigger than the limit.Could someone give me some suggestions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.