目录
一.大佬资源
镭神N10激光雷达Ubuntu18.04使用教程_n10激光雷达镭神-优快云博客
里面有资料,该资料为M10资料,不过只需要修改launch文件并按照笔者的步骤N10也可以使用。
其实下载完资源直接去看那个 镭神智能_M10_用户手册_V1.5.9_20230809.pdf 就可以了,就是要改一下launch文件
二.报错解决
1.检查串口设备连接时无输出
终端没有输出:
wlm@wlm-virtual-machine:~$ ls /dev/ | grep ttyU
wlm@wlm-virtual-machine:~$ ls /dev/ | grep ttyU
wlm@wlm-virtual-machine:~$
可以借鉴: linux查看usb设备文件,4 种方法识别Linux系统 USB 设备-优快云博客
搜了百度,我怀疑是串口设备文件名错误:
在Linux中,串口设备通常被命名为/dev/ttyUSB0、/dev/ttyACM0、/dev/ttyS0等。确保你使用的设备文件名正确。你可以通过以下命令列出所有可用的串口设备:
ls /dev/tty*
查看列表中是否有你的设备。
我的终端输出如下:
wlm@wlm-virtual-machine:~$ ls /dev/tty*
/dev/tty /dev/tty23 /dev/tty39 /dev/tty54 /dev/ttyS1 /dev/ttyS25
/dev/tty0 /dev/tty24 /dev/tty4 /dev/tty55 /dev/ttyS10 /dev/ttyS26
/dev/tty1 /dev/tty25 /dev/tty40 /dev/tty56 /dev/ttyS11 /dev/ttyS27
/dev/tty10 /dev/tty26 /dev/tty41 /dev/tty57 /dev/ttyS12 /dev/ttyS28
/dev/tty11 /dev/tty27 /dev/tty42 /dev/tty58 /dev/ttyS13 /dev/ttyS29
/dev/tty12 /dev/tty28 /dev/tty43 /dev/tty59 /dev/ttyS14 /dev/ttyS3
/dev/tty13 /dev/tty29 /dev/tty44 /dev/tty6 /dev/ttyS15 /dev/ttyS30
/dev/tty14 /dev/tty3 /dev/tty45 /dev/tty60 /dev/ttyS16 /dev/ttyS31
/dev/tty15 /dev/tty30 /dev/tty46 /dev/tty61 /dev/ttyS17 /dev/ttyS4
/dev/tty16 /dev/tty31 /dev/tty47 /dev/tty62 /dev/ttyS18 /dev/ttyS5
/dev/tty17 /dev/tty32 /dev/tty48 /dev/tty63 /dev/ttyS19 /dev/ttyS6
/dev/tty18 /dev/tty33 /dev/tty49 /dev/tty7 /dev/ttyS2 /dev/ttyS7
/dev/tty19 /dev/tty34 /dev/tty5 /dev/tty8 /dev/ttyS20 /dev/ttyS8
/dev/tty2 /dev/tty35 /dev/tty50 /dev/tty9 /dev/ttyS21 /dev/ttyS9
/dev/tty20 /dev/tty36 /dev/tty51 /dev/ttyCH343USB0 /dev/ttyS22
/dev/tty21 /dev/tty37 /dev/tty52 /dev/ttyprintk /dev/ttyS23
/dev/tty22 /dev/tty38 /dev/tty53 /dev/ttyS0 /dev/ttyS24
我的串口设备为/dev/ttyCH343USB0。
于是我的解决办法是输入我的串口设备名称:
wlm@wlm-virtual-machine:~$ ls /dev/ |grep ttyCH343USB0
ttyCH343USB0
结果输出端输出红色字体ttyCH343USB0。此时检查设备已连接上。
问题解决!!
相应的在赋予串口权限时也要改一下串口的名称。
2.编译打包时报错
就是进入leishen_ws空间时,要编译下面命令行时出现了报错:
cd ~/leishen_ws
catkin_make
报错如下:
[ 8%] Built target roscpp_generate_messages_py
[ 8%] Built target bond_generate_messages_cpp
[ 8%] Built target geometry_msgs_generate_messages_nodejs
[ 8%] Built target bond_generate_messages_eus
In file included from /home/wlm/leishen_ws/src/lslidar_driver/src/input.cc:18:0:
/home/wlm/leishen_ws/src/lslidar_driver/include/lslidar_driver/input.h:35:10: fatal error: lslidar_msgs/LslidarPacket.h: 没有那个文件或目录
#include <lslidar_msgs/LslidarPacket.h> //报错在此
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[ 8%] Built target bond_generate_messages_py
lslidar_driver/CMakeFiles/lslidar_input.dir/build.make:75: recipe for target 'lslidar_driver/CMakeFiles/lslidar_input.dir/src/input.cc.o' failed
make[2]: *** [lslidar_driver/CMakeFiles/lslidar_input.dir/src/input.cc.o] Error 1
CMakeFiles/Makefile2:1515: recipe for target 'lslidar_driver/CMakeFiles/lslidar_input.dir/all' failed
make[1]: *** [lslidar_driver/CMakeFiles/lslidar_input.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[ 8%] Built target nodelet_generate_messages_cpp
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j2 -l2" failed
图:
我的解决办法:
(也是借鉴别人的博客,写到此处也只是记录以下,方便自己以后使用)
sudo apt-get install libpcap-dev
cd leishen_ws/src/
catkin_make -DCATKIN_WHITELIST_PACKAGES=lslidar_msgs
catkin_make -DCATKIN_WHITELIST_PACKAGES=lslidar_driver
catkin_make
结果如下:
(1)执行完catkin_make -DCATKIN_WHITELIST_PACKAGES=lslidar_msgs:
wlm@wlm-virtual-machine:~/leishen_ws$ catkin_make -DCATKIN_WHITELIST_PACKAGES=lslidar_msgs
Base path: /home/wlm/leishen_ws
Source space: /home/wlm/leishen_ws/src
Build space: /home/wlm/leishen_ws/build
Devel space: /home/wlm/leishen_ws/devel
Install space: /home/wlm/leishen_ws/install
Creating symlink "/home/wlm/leishen_ws/src/CMakeLists.txt" pointing to "/opt/ros/melodic/share/catkin/cmake/toplevel.cmake"
####
#### Running command: "cmake /home/wlm/leishen_ws/src -DCATKIN_WHITELIST_PACKAGES=lslidar_msgs -DCATKIN_DEVEL_PREFIX=/home/wlm/leishen_ws/devel -DCMAKE_INSTALL_PREFIX=/home/wlm/leishen_ws/install -G Unix Makefiles" in "/home/wlm/leishen_ws/build"
####
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/wlm/leishen_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/wlm/leishen_ws/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
CMake Deprecation Warning at /usr/src/googletest/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at /usr/src/googletest/googlemock/CMakeLists.txt:41 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at /usr/src/googletest/googletest/CMakeLists.txt:48 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- Using CATKIN_WHITELIST_PACKAGES: lslidar_msgs
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - lslidar_msgs
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'lslidar_msgs'
-- ==> add_subdirectory(lslidar_msgs)
CMake Deprecation Warning at lslidar_msgs/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- lslidar_msgs: 5 messages, 0 services
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wlm/leishen_ws/build
####
#### Running command: "make -j2 -l2" in "/home/wlm/leishen_ws/build"
####
[ 0%] Built target std_msgs_generate_messages_eus
[ 0%] Built target _lslidar_msgs_generate_messages_check_deps_LslidarPoint
[ 0%] Built target _lslidar_msgs_generate_messages_check_deps_LslidarScan
[ 0%] Built target _lslidar_msgs_generate_messages_check_deps_LslidarSweep
[ 0%] Built target _lslidar_msgs_generate_messages_check_deps_LslidarDifop
[ 0%] Built target std_msgs_generate_messages_py
[ 0%] Built target _lslidar_msgs_generate_messages_check_deps_LslidarPacket
[ 0%] Built target std_msgs_generate_messages_nodejs
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_cpp
[ 3%] Generating EusLisp code from lslidar_msgs/LslidarPoint.msg
[ 7%] Generating Python from MSG lslidar_msgs/LslidarPoint
[ 11%] Generating EusLisp code from lslidar_msgs/LslidarPacket.msg
[ 14%] Generating EusLisp code from lslidar_msgs/LslidarDifop.msg
[ 18%] Generating EusLisp code from lslidar_msgs/LslidarScan.msg
[ 22%] Generating EusLisp code from lslidar_msgs/LslidarSweep.msg
[ 25%] Generating EusLisp manifest code for lslidar_msgs
[ 29%] Generating Python from MSG lslidar_msgs/LslidarPacket
[ 33%] Generating Python from MSG lslidar_msgs/LslidarDifop
[ 37%] Generating Python from MSG lslidar_msgs/LslidarScan
[ 40%] Generating Python from MSG lslidar_msgs/LslidarSweep
[ 40%] Built target lslidar_msgs_generate_messages_eus
[ 44%] Generating Javascript code from lslidar_msgs/LslidarPoint.msg
[ 48%] Generating Javascript code from lslidar_msgs/LslidarPacket.msg
[ 51%] Generating Python msg __init__.py for lslidar_msgs
[ 55%] Generating Javascript code from lslidar_msgs/LslidarDifop.msg
[ 59%] Generating Javascript code from lslidar_msgs/LslidarScan.msg
[ 62%] Generating Javascript code from lslidar_msgs/LslidarSweep.msg
[ 62%] Built target lslidar_msgs_generate_messages_nodejs
[ 66%] Generating Lisp code from lslidar_msgs/LslidarPoint.msg
[ 66%] Built target lslidar_msgs_generate_messages_py
[ 70%] Generating Lisp code from lslidar_msgs/LslidarPacket.msg
[ 74%] Generating C++ code from lslidar_msgs/LslidarPoint.msg
[ 77%] Generating Lisp code from lslidar_msgs/LslidarDifop.msg
[ 81%] Generating Lisp code from lslidar_msgs/LslidarScan.msg
[ 85%] Generating Lisp code from lslidar_msgs/LslidarSweep.msg
[ 88%] Generating C++ code from lslidar_msgs/LslidarPacket.msg
[ 88%] Built target lslidar_msgs_generate_messages_lisp
[ 92%] Generating C++ code from lslidar_msgs/LslidarDifop.msg
[ 96%] Generating C++ code from lslidar_msgs/LslidarScan.msg
[100%] Generating C++ code from lslidar_msgs/LslidarSweep.msg
[100%] Built target lslidar_msgs_generate_messages_cpp
[100%] Built target lslidar_msgs_generate_messages
(2)执行完catkin_make -DCATKIN_WHITELIST_PACKAGES=lslidar_driver:
wlm@wlm-virtual-machine:~/leishen_ws$ catkin_make -DCATKIN_WHITELIST_PACKAGES=lslidar_driver
Base path: /home/wlm/leishen_ws
Source space: /home/wlm/leishen_ws/src
Build space: /home/wlm/leishen_ws/build
Devel space: /home/wlm/leishen_ws/devel
Install space: /home/wlm/leishen_ws/install
####
#### Running command: "cmake /home/wlm/leishen_ws/src -DCATKIN_WHITELIST_PACKAGES=lslidar_driver -DCATKIN_DEVEL_PREFIX=/home/wlm/leishen_ws/devel -DCMAKE_INSTALL_PREFIX=/home/wlm/leishen_ws/install -G Unix Makefiles" in "/home/wlm/leishen_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/wlm/leishen_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/wlm/leishen_ws/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
CMake Deprecation Warning at /usr/src/googletest/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at /usr/src/googletest/googlemock/CMakeLists.txt:41 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at /usr/src/googletest/googletest/CMakeLists.txt:48 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17")
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- Using CATKIN_WHITELIST_PACKAGES: lslidar_driver
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - lslidar_driver
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'lslidar_driver'
-- ==> add_subdirectory(lslidar_driver)
CMake Deprecation Warning at lslidar_driver/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Found Boost: /usr/include (found version "1.65.1")
CMake Warning at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'boost' but neither 'boost_INCLUDE_DIRS' nor
'boost_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
lslidar_driver/CMakeLists.txt:22 (catkin_package)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wlm/leishen_ws/build
####
#### Running command: "make -j2 -l2" in "/home/wlm/leishen_ws/build"
####
[ 0%] Built target actionlib_msgs_generate_messages_py
[ 12%] Building CXX object lslidar_driver/CMakeFiles/lslidar_serial.dir/src/lsiosr.cpp.o
[ 12%] Built target lslidar_msgs_generate_messages_nodejs
[ 12%] Built target lslidar_msgs_generate_messages_eus
[ 12%] Built target lslidar_msgs_generate_messages_cpp
[ 12%] Built target tf2_msgs_generate_messages_nodejs
[ 12%] Built target tf2_msgs_generate_messages_eus
[ 12%] Built target tf2_msgs_generate_messages_cpp
[ 12%] Built target nodelet_generate_messages_nodejs
[ 12%] Built target pcl_msgs_generate_messages_nodejs
[ 12%] Built target nodelet_generate_messages_eus
[ 12%] Built target diagnostic_msgs_generate_messages_py
[ 12%] Built target std_msgs_generate_messages_cpp
[ 12%] Built target diagnostic_msgs_generate_messages_nodejs
[ 12%] Built target dynamic_reconfigure_generate_messages_py
[ 12%] Built target diagnostic_msgs_generate_messages_lisp
[ 12%] Built target dynamic_reconfigure_generate_messages_eus
[ 12%] Built target geometry_msgs_generate_messages_py
[ 12%] Built target geometry_msgs_generate_messages_lisp
[ 12%] Built target diagnostic_msgs_generate_messages_eus
[ 12%] Built target lslidar_msgs_generate_messages_py
[ 12%] Built target actionlib_msgs_generate_messages_lisp
[ 12%] Built target nodelet_generate_messages_py
[ 12%] Built target sensor_msgs_generate_messages_py
[ 12%] Built target sensor_msgs_generate_messages_nodejs
[ 12%] Built target roscpp_generate_messages_cpp
[ 12%] Built target actionlib_generate_messages_cpp
[ 12%] Built target sensor_msgs_generate_messages_lisp
[ 12%] Built target geometry_msgs_generate_messages_eus
[ 12%] Built target roscpp_generate_messages_py
[ 12%] Built target geometry_msgs_generate_messages_nodejs
[ 12%] Built target std_srvs_generate_messages_eus
[ 12%] Built target roscpp_generate_messages_lisp
[ 25%] Linking CXX shared library /home/wlm/leishen_ws/devel/lib/liblslidar_serial.so
[ 25%] Built target bond_generate_messages_eus
[ 25%] Built target rosgraph_msgs_generate_messages_cpp
[ 25%] Built target tf_generate_messages_py
[ 25%] Built target dynamic_reconfigure_generate_messages_cpp
[ 25%] Built target topic_tools_generate_messages_cpp
[ 25%] Built target nodelet_generate_messages_lisp
[ 25%] Built target sensor_msgs_generate_messages_eus
[ 25%] Built target sensor_msgs_generate_messages_cpp
[ 25%] Built target roscpp_generate_messages_nodejs
[ 25%] Built target std_msgs_generate_messages_lisp
[ 25%] Built target nodelet_generate_messages_cpp
[ 25%] Built target bond_generate_messages_py
[ 25%] Built target std_srvs_generate_messages_nodejs
[ 25%] Built target geometry_msgs_generate_messages_cpp
[ 25%] Built target actionlib_generate_messages_lisp
[ 25%] Built target rosgraph_msgs_generate_messages_eus
[ 25%] Built target rosgraph_msgs_generate_messages_lisp
[ 25%] Built target rosgraph_msgs_generate_messages_nodejs
[ 25%] Built target roscpp_generate_messages_eus
[ 25%] Built target actionlib_msgs_generate_messages_eus
[ 25%] Built target rosgraph_msgs_generate_messages_py
[ 25%] Built target std_msgs_generate_messages_eus
[ 25%] Built target std_msgs_generate_messages_nodejs
[ 25%] Built target bond_generate_messages_lisp
[ 25%] Built target bond_generate_messages_cpp
[ 25%] Built target std_msgs_generate_messages_py
[ 37%] Building CXX object lslidar_driver/CMakeFiles/lslidar_input.dir/src/input.cc.o
[ 37%] Built target lslidar_serial
[ 37%] Built target bond_generate_messages_nodejs
[ 37%] Built target pcl_ros_gencfg
[ 37%] Built target topic_tools_generate_messages_nodejs
[ 37%] Built target lslidar_msgs_generate_messages_lisp
[ 37%] Built target tf2_msgs_generate_messages_py
[ 37%] Built target actionlib_generate_messages_py
[ 37%] Built target dynamic_reconfigure_generate_messages_lisp
[ 37%] Built target pcl_msgs_generate_messages_cpp
[ 37%] Built target dynamic_reconfigure_generate_messages_nodejs
[ 37%] Built target tf2_msgs_generate_messages_lisp
[ 37%] Built target dynamic_reconfigure_gencfg
[ 37%] Built target std_srvs_generate_messages_lisp
[ 37%] Built target topic_tools_generate_messages_lisp
[ 37%] Built target pcl_msgs_generate_messages_eus
[ 37%] Built target topic_tools_generate_messages_eus
[ 37%] Built target std_srvs_generate_messages_cpp
[ 37%] Built target tf_generate_messages_eus
[ 37%] Built target actionlib_msgs_generate_messages_cpp
[ 37%] Built target std_srvs_generate_messages_py
[ 37%] Built target tf_generate_messages_lisp
[ 37%] Built target tf_generate_messages_nodejs
[ 37%] Built target diagnostic_msgs_generate_messages_cpp
[ 37%] Built target pcl_msgs_generate_messages_py
[ 37%] Built target actionlib_generate_messages_eus
[ 37%] Built target pcl_msgs_generate_messages_lisp
[ 37%] Built target tf_generate_messages_cpp
[ 37%] Built target actionlib_generate_messages_nodejs
[ 37%] Built target topic_tools_generate_messages_py
[ 37%] Built target nodelet_topic_tools_gencfg
[ 37%] Built target actionlib_msgs_generate_messages_nodejs
[ 50%] Linking CXX shared library /home/wlm/leishen_ws/devel/lib/liblslidar_input.so
[ 50%] Built target lslidar_input
[ 62%] Building CXX object lslidar_driver/CMakeFiles/lslidar_driver.dir/src/lslidar_driver.cc.o
[ 75%] Linking CXX shared library /home/wlm/leishen_ws/devel/lib/liblslidar_driver.so
[ 75%] Built target lslidar_driver
[ 87%] Building CXX object lslidar_driver/CMakeFiles/lslidar_driver_node.dir/src/lslidar_driver_node.cc.o
[100%] Linking CXX executable /home/wlm/leishen_ws/devel/lib/lslidar_driver/lslidar_driver_node
[100%] Built target lslidar_driver_node
(3)执行完catkin_make后:
wlm@wlm-virtual-machine:~/leishen_ws$ catkin_make
Base path: /home/wlm/leishen_ws
Source space: /home/wlm/leishen_ws/src
Build space: /home/wlm/leishen_ws/build
Devel space: /home/wlm/leishen_ws/devel
Install space: /home/wlm/leishen_ws/install
####
#### Running command: "cmake /home/wlm/leishen_ws/src -DCATKIN_DEVEL_PREFIX=/home/wlm/leishen_ws/devel -DCMAKE_INSTALL_PREFIX=/home/wlm/leishen_ws/install -G Unix Makefiles" in "/home/wlm/leishen_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/wlm/leishen_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/wlm/leishen_ws/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
CMake Deprecation Warning at /usr/src/googletest/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at /usr/src/googletest/googlemock/CMakeLists.txt:41 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at /usr/src/googletest/googletest/CMakeLists.txt:48 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17")
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- Using CATKIN_WHITELIST_PACKAGES: lslidar_driver
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - lslidar_driver
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'lslidar_driver'
-- ==> add_subdirectory(lslidar_driver)
CMake Deprecation Warning at lslidar_driver/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Warning at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on 'boost' but neither 'boost_INCLUDE_DIRS' nor
'boost_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
lslidar_driver/CMakeLists.txt:22 (catkin_package)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wlm/leishen_ws/build
####
#### Running command: "make -j2 -l2" in "/home/wlm/leishen_ws/build"
####
Consolidate compiler generated dependencies of target lslidar_serial
[ 0%] Built target actionlib_msgs_generate_messages_py
[ 25%] Built target lslidar_serial
[ 25%] Built target lslidar_msgs_generate_messages_nodejs
[ 25%] Built target lslidar_msgs_generate_messages_eus
[ 25%] Built target lslidar_msgs_generate_messages_cpp
[ 25%] Built target tf2_msgs_generate_messages_nodejs
[ 25%] Built target tf2_msgs_generate_messages_eus
[ 25%] Built target tf2_msgs_generate_messages_cpp
[ 25%] Built target nodelet_generate_messages_nodejs
[ 25%] Built target pcl_msgs_generate_messages_nodejs
[ 25%] Built target nodelet_generate_messages_eus
[ 25%] Built target diagnostic_msgs_generate_messages_py
[ 25%] Built target std_msgs_generate_messages_cpp
[ 25%] Built target diagnostic_msgs_generate_messages_nodejs
[ 25%] Built target dynamic_reconfigure_generate_messages_py
[ 25%] Built target diagnostic_msgs_generate_messages_lisp
[ 25%] Built target dynamic_reconfigure_generate_messages_eus
[ 25%] Built target geometry_msgs_generate_messages_py
[ 25%] Built target diagnostic_msgs_generate_messages_eus
[ 25%] Built target geometry_msgs_generate_messages_lisp
[ 25%] Built target actionlib_msgs_generate_messages_lisp
[ 25%] Built target lslidar_msgs_generate_messages_py
[ 25%] Built target nodelet_generate_messages_py
[ 25%] Built target sensor_msgs_generate_messages_py
[ 25%] Built target sensor_msgs_generate_messages_nodejs
[ 25%] Built target roscpp_generate_messages_cpp
[ 25%] Built target actionlib_generate_messages_cpp
[ 25%] Built target sensor_msgs_generate_messages_lisp
[ 25%] Built target roscpp_generate_messages_py
[ 25%] Built target geometry_msgs_generate_messages_eus
[ 25%] Built target geometry_msgs_generate_messages_nodejs
[ 25%] Built target std_srvs_generate_messages_eus
[ 25%] Built target roscpp_generate_messages_lisp
[ 25%] Built target bond_generate_messages_eus
[ 25%] Built target rosgraph_msgs_generate_messages_cpp
[ 25%] Built target tf_generate_messages_py
[ 25%] Built target dynamic_reconfigure_generate_messages_cpp
[ 25%] Built target topic_tools_generate_messages_cpp
[ 25%] Built target nodelet_generate_messages_lisp
[ 25%] Built target sensor_msgs_generate_messages_eus
[ 25%] Built target sensor_msgs_generate_messages_cpp
[ 25%] Built target roscpp_generate_messages_nodejs
[ 25%] Built target std_msgs_generate_messages_lisp
[ 25%] Built target nodelet_generate_messages_cpp
[ 25%] Built target bond_generate_messages_py
[ 25%] Built target std_srvs_generate_messages_nodejs
[ 25%] Built target geometry_msgs_generate_messages_cpp
[ 25%] Built target actionlib_generate_messages_lisp
[ 25%] Built target rosgraph_msgs_generate_messages_eus
[ 25%] Built target rosgraph_msgs_generate_messages_nodejs
[ 25%] Built target rosgraph_msgs_generate_messages_lisp
[ 25%] Built target roscpp_generate_messages_eus
[ 25%] Built target actionlib_msgs_generate_messages_eus
[ 25%] Built target rosgraph_msgs_generate_messages_py
[ 25%] Built target std_msgs_generate_messages_eus
[ 25%] Built target std_msgs_generate_messages_nodejs
[ 25%] Built target bond_generate_messages_lisp
[ 25%] Built target bond_generate_messages_cpp
[ 25%] Built target std_msgs_generate_messages_py
Consolidate compiler generated dependencies of target lslidar_input
[ 25%] Built target bond_generate_messages_nodejs
[ 25%] Built target pcl_ros_gencfg
[ 25%] Built target topic_tools_generate_messages_nodejs
[ 25%] Built target lslidar_msgs_generate_messages_lisp
[ 50%] Built target lslidar_input
[ 50%] Built target tf2_msgs_generate_messages_py
[ 50%] Built target actionlib_generate_messages_py
[ 50%] Built target dynamic_reconfigure_generate_messages_lisp
[ 50%] Built target pcl_msgs_generate_messages_cpp
[ 50%] Built target dynamic_reconfigure_generate_messages_nodejs
[ 50%] Built target tf2_msgs_generate_messages_lisp
[ 50%] Built target dynamic_reconfigure_gencfg
[ 50%] Built target std_srvs_generate_messages_lisp
[ 50%] Built target topic_tools_generate_messages_lisp
[ 50%] Built target pcl_msgs_generate_messages_eus
[ 50%] Built target topic_tools_generate_messages_eus
[ 50%] Built target std_srvs_generate_messages_cpp
[ 50%] Built target actionlib_msgs_generate_messages_cpp
[ 50%] Built target tf_generate_messages_eus
[ 50%] Built target std_srvs_generate_messages_py
[ 50%] Built target tf_generate_messages_lisp
[ 50%] Built target tf_generate_messages_nodejs
[ 50%] Built target diagnostic_msgs_generate_messages_cpp
[ 50%] Built target pcl_msgs_generate_messages_py
[ 50%] Built target actionlib_generate_messages_eus
[ 50%] Built target pcl_msgs_generate_messages_lisp
[ 50%] Built target tf_generate_messages_cpp
[ 50%] Built target actionlib_generate_messages_nodejs
[ 50%] Built target topic_tools_generate_messages_py
[ 50%] Built target nodelet_topic_tools_gencfg
[ 50%] Built target actionlib_msgs_generate_messages_nodejs
Consolidate compiler generated dependencies of target lslidar_driver
[ 75%] Built target lslidar_driver
Consolidate compiler generated dependencies of target lslidar_driver_node
[100%] Built target lslidar_driver_node
大功告成,问题解决!!
3.运行程序时报错
在leishen_ws中运行下面命令行时报错:
source devel/setup.bash
roslaunch lsm10_v2 lsm10_v2.launch
报错如下:
wlm@wlm-virtual-machine:~/leishen_ws$ source devel/setup.bash
wlm@wlm-virtual-machine:~/leishen_ws$ roslaunch lsm10_v2 lsm10_v2.launch
RLException: [lsm10_v2.launch] is neither a launch file in package [lsm10_v2] nor is [lsm10_v2] a launch file name
The traceback for the exception was written to the log file
哈哈哈哈,看了几分钟才发现,为是按着M10用户手册来的,忘了我的是镭神N10,已经把launch文件按照要求改了,所以第二个命令写错了,应该是:
更新ROS环境,让ros识别驱动包
source devel/setup.bash
运行驱动程序
roslaunch lslidar_driver lslidar_serial.launch
不要再搞错了哟!!
三.结果展示图
第二张图我勾选了LaserScan和Axes,把坐标也显示出来了:
四.小结
小车是老师给我的小车,我用数据线连接小车上的nano板子和我的电脑,并连接到ubuntu虚拟机上。想要控制小车,还需设置参数,看我慢慢摸索,等我下一篇博客出来。
(是基于cartographer的),目前会参考到的博客: