蓝桥ROS机器人课程之无限扩展∞∞∞(程序设计案例)
Posted zhangrelay
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了蓝桥ROS机器人课程之无限扩展∞∞∞(程序设计案例)相关的知识,希望对你有一定的参考价值。
蓝桥ROS机器人初级版云实践平台已经推出5年多了。
评分>9,我觉得不足之处主要是没时间维护。案例也没怎么更新。
虽然课程上都讲过,但是并没有更新到课程当中。
现在简单扩展一下:
zhangrelay / ros_book · GitCode
比如这里面分享的代码和书籍,案例直接或间接可用。
对教学而言十分方便,对于学生而言使用实践起来也很容易的。
使用:
git clone https://gitcode.net/ZhangRelay/ros_book.git
将资源下载到蓝桥ROS的Code文件夹下:
解压缩源代码:
编译第三章案例:
测试一下啊
当然,如果编译第四章案例会遇到错误,类似问题已经在博客:
这里复现,并重复一下:
将navigation中的对应包放入到指定位置:
再次编译,一切ok。
学习知识,非常重要,但是掌握高效率发现问题,分析问题,解决问题一整套思路更加重要。
效果如下:
控制运动后效果如下:
shiyanlou:demo/ $ catkin_make [10:43:11]
Base path: /home/shiyanlou/Code/demo
Source space: /home/shiyanlou/Code/demo/src
Build space: /home/shiyanlou/Code/demo/build
Devel space: /home/shiyanlou/Code/demo/devel
Install space: /home/shiyanlou/Code/demo/install
Creating symlink "/home/shiyanlou/Code/demo/src/CMakeLists.txt" pointing to "/opt/ros/kinetic/share/catkin/cmake/toplevel.cmake"
####
#### Running command: "cmake /home/shiyanlou/Code/demo/src -DCATKIN_DEVEL_PREFIX=/home/shiyanlou/Code/demo/devel -DCMAKE_INSTALL_PREFIX=/home/shiyanlou/Code/demo/install -G Unix Makefiles" in "/home/shiyanlou/Code/demo/build"
####
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/shiyanlou/Code/demo/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/shiyanlou/Code/demo/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- 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
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 3 packages in topological order:
-- ~~ - chapter4_tutorials (metapackage)
-- ~~ - robot1_gazebo
-- ~~ - robot1_description
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'chapter4_tutorials'
-- ==> add_subdirectory(chapter4_tutorials/chapter4_tutorials)
-- +++ processing catkin package: 'robot1_gazebo'
-- ==> add_subdirectory(chapter4_tutorials/robot1_gazebo)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'robot1_description'
-- ==> add_subdirectory(chapter4_tutorials/robot1_description)
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by "fake_localization"
with any of the following names:
fake_localizationConfig.cmake
fake_localization-config.cmake
Add the installation prefix of "fake_localization" to CMAKE_PREFIX_PATH or
set "fake_localization_DIR" to a directory containing one of the above
files. If "fake_localization" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
chapter4_tutorials/robot1_description/CMakeLists.txt:7 (find_package)
-- Could not find the required component 'fake_localization'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "fake_localization"
with any of the following names:
fake_localizationConfig.cmake
fake_localization-config.cmake
Add the installation prefix of "fake_localization" to CMAKE_PREFIX_PATH or
set "fake_localization_DIR" to a directory containing one of the above
files. If "fake_localization" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
chapter4_tutorials/robot1_description/CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/shiyanlou/Code/demo/build/CMakeFiles/CMakeOutput.log".
See also "/home/shiyanlou/Code/demo/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
shiyanlou:demo/ $ catkin_make [10:43:20]
Base path: /home/shiyanlou/Code/demo
Source space: /home/shiyanlou/Code/demo/src
Build space: /home/shiyanlou/Code/demo/build
Devel space: /home/shiyanlou/Code/demo/devel
Install space: /home/shiyanlou/Code/demo/install
####
#### Running command: "cmake /home/shiyanlou/Code/demo/src -DCATKIN_DEVEL_PREFIX=/home/shiyanlou/Code/demo/devel -DCMAKE_INSTALL_PREFIX=/home/shiyanlou/Code/demo/install -G Unix Makefiles" in "/home/shiyanlou/Code/demo/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/shiyanlou/Code/demo/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/shiyanlou/Code/demo/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 4 packages in topological order:
-- ~~ - chapter4_tutorials (metapackage)
-- ~~ - robot1_gazebo
-- ~~ - fake_localization
-- ~~ - robot1_description
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'chapter4_tutorials'
-- ==> add_subdirectory(chapter4_tutorials/chapter4_tutorials)
-- +++ processing catkin package: 'robot1_gazebo'
-- ==> add_subdirectory(chapter4_tutorials/robot1_gazebo)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'fake_localization'
-- ==> add_subdirectory(fake_localization)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- signals
-- +++ processing catkin package: 'robot1_description'
-- ==> add_subdirectory(chapter4_tutorials/robot1_description)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Configuring done
-- Generating done
-- Build files have been written to: /home/shiyanlou/Code/demo/build
####
#### Running command: "make -j4 -l4" in "/home/shiyanlou/Code/demo/build"
####
Scanning dependencies of target tf2_msgs_generate_messages_nodejs
Scanning dependencies of target tf2_msgs_generate_messages_lisp
Scanning dependencies of target nav_msgs_generate_messages_cpp
Scanning dependencies of target tf2_msgs_generate_messages_eus
[ 0%] Built target tf2_msgs_generate_messages_nodejs
[ 0%] Built target tf2_msgs_generate_messages_eus
[ 0%] Built target nav_msgs_generate_messages_cpp
[ 0%] Built target tf2_msgs_generate_messages_lisp
Scanning dependencies of target std_msgs_generate_messages_lisp
Scanning dependencies of target roscpp_generate_messages_nodejs
Scanning dependencies of target tf2_msgs_generate_messages_cpp
Scanning dependencies of target geometry_msgs_generate_messages_nodejs
[ 0%] Built target tf2_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target roscpp_generate_messages_nodejs
[ 0%] Built target geometry_msgs_generate_messages_nodejs
Scanning dependencies of target geometry_msgs_generate_messages_lisp
Scanning dependencies of target roscpp_generate_messages_lisp
Scanning dependencies of target roscpp_generate_messages_cpp
Scanning dependencies of target geometry_msgs_generate_messages_eus
[ 0%] Built target roscpp_generate_messages_cpp
[ 0%] Built target geometry_msgs_generate_messages_eus
[ 0%] Built target geometry_msgs_generate_messages_lisp
[ 0%] Built target roscpp_generate_messages_lisp
Scanning dependencies of target actionlib_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_py
Scanning dependencies of target geometry_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_nodejs
[ 0%] Built target std_msgs_generate_messages_py
[ 0%] Built target actionlib_msgs_generate_messages_py
[ 0%] Built target std_msgs_generate_messages_nodejs
[ 0%] Built target geometry_msgs_generate_messages_py
Scanning dependencies of target geometry_msgs_generate_messages_cpp
Scanning dependencies of target roscpp_generate_messages_eus
Scanning dependencies of target rosgraph_msgs_generate_messages_cpp
Scanning dependencies of target rosgraph_msgs_generate_messages_nodejs
[ 0%] Built target geometry_msgs_generate_messages_cpp
[ 0%] Built target rosgraph_msgs_generate_messages_cpp
[ 0%] Built target rosgraph_msgs_generate_messages_nodejs
Scanning dependencies of target rosgraph_msgs_generate_messages_eus
[ 0%] Built target roscpp_generate_messages_eus
Scanning dependencies of target actionlib_generate_messages_eus
Scanning dependencies of target std_msgs_generate_messages_eus
Scanning dependencies of target rosgraph_msgs_generate_messages_lisp
[ 0%] Built target rosgraph_msgs_generate_messages_eus
[ 0%] Built target std_msgs_generate_messages_eus
[ 0%] Built target actionlib_generate_messages_eus
Scanning dependencies of target roscpp_generate_messages_py
Scanning dependencies of target rosgraph_msgs_generate_messages_py
[ 0%] Built target rosgraph_msgs_generate_messages_lisp
Scanning dependencies of target actionlib_generate_messages_cpp
[ 0%] Built target roscpp_generate_messages_py
[ 0%] Built target actionlib_generate_messages_cpp
[ 0%] Built target rosgraph_msgs_generate_messages_py
Scanning dependencies of target tf2_msgs_generate_messages_py
Scanning dependencies of target actionlib_msgs_generate_messages_nodejs
Scanning dependencies of target std_msgs_generate_messages_cpp
Scanning dependencies of target actionlib_msgs_generate_messages_cpp
[ 0%] Built target actionlib_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_cpp
[ 0%] Built target tf2_msgs_generate_messages_py
[ 0%] Built target actionlib_msgs_generate_messages_nodejs
Scanning dependencies of target actionlib_generate_messages_nodejs
Scanning dependencies of target actionlib_generate_messages_py
Scanning dependencies of target actionlib_msgs_generate_messages_eus
Scanning dependencies of target actionlib_generate_messages_lisp
[ 0%] Built target actionlib_generate_messages_nodejs
[ 0%] Built target actionlib_msgs_generate_messages_eus
[ 0%] Built target actionlib_generate_messages_py
Scanning dependencies of target actionlib_msgs_generate_messages_lisp
[ 0%] Built target actionlib_generate_messages_lisp
[ 0%] Built target actionlib_msgs_generate_messages_lisp
Scanning dependencies of target nav_msgs_generate_messages_eus
Scanning dependencies of target nav_msgs_generate_messages_nodejs
Scanning dependencies of target nav_msgs_generate_messages_lisp
Scanning dependencies of target nav_msgs_generate_messages_py
[ 0%] Built target nav_msgs_generate_messages_lisp
[ 0%] Built target nav_msgs_generate_messages_nodejs
[ 0%] Built target nav_msgs_generate_messages_eus
[ 0%] Built target nav_msgs_generate_messages_py
Scanning dependencies of target robot1_description_xacro_generated_to_devel_space_
Scanning dependencies of target state_publisher_tutorials
Scanning dependencies of target fake_localization
[ 0%] Built target robot1_description_xacro_generated_to_devel_space_
[ 25%] Building CXX object fake_localization/CMakeFiles/fake_localization.dir/fake_localization.cpp.o
[ 50%] Building CXX object chapter4_tutorials/robot1_description/CMakeFiles/state_publisher_tutorials.dir/src/state_publisher.cpp.o
[ 75%] Linking CXX executable /home/shiyanlou/Code/demo/devel/lib/robot1_description/state_publisher_tutorials
[ 75%] Built target state_publisher_tutorials
[100%] Linking CXX executable /home/shiyanlou/Code/demo/devel/lib/fake_localization/fake_localization
[100%] Built target fake_localization
shiyanlou:demo/ $ [10:45:04]
以上是关于蓝桥ROS机器人课程之无限扩展∞∞∞(程序设计案例)的主要内容,如果未能解决你的问题,请参考以下文章
蓝桥ROS机器人之turtlesim贪吃蛇移植到Win11中