首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >蓝桥ROS机器人之第一个功能包helloros

蓝桥ROS机器人之第一个功能包helloros

作者头像
zhangrelay
发布于 2022-05-01 02:21:25
发布于 2022-05-01 02:21:25
55300
代码可运行
举报
运行总次数:0
代码可运行

helloros

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
cmake_minimum_required(VERSION 2.8.3)
project(helloros)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## 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 tag for "message_generation"
##   * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
##     but can be declared for certainty nonetheless:
##     * add a exec_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  # Or other packages containing msgs
# )

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
##   * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
##   * add "dynamic_reconfigure" to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * uncomment the "generate_dynamic_reconfigure_options" section below
##     and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
#   cfg/DynReconf1.cfg
#   cfg/DynReconf2.cfg
# )

###################################
## 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 your 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 helloros
#  CATKIN_DEPENDS roscpp
#  DEPENDS system_lib
)

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

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

## Declare a C++ library
# add_library(${PROJECT_NAME}
#   src/${PROJECT_NAME}/helloros.cpp
# )

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/helloros_node.cpp)
add_executable(${PROJECT_NAME}_node src/helloros.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
#   ${catkin_LIBRARIES}
# )
target_link_libraries(${PROJECT_NAME}_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 ${PROJECT_NAME} ${PROJECT_NAME}_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_helloros.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)
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
#include <ros/ros.h>

int main ( int argc , char ** argv ) {
// Initialize the ROS system . 
	ros::init( argc , argv , "hello_ros" ); 
// Establish this program as a ROS node . 
	ros::NodeHandle nh;
// Send some output as a log message . 
	ROS_INFO_STREAM( "Hello nihao, ROS!" );
}

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
shiyanlou:src/ $ catkin_create_pkg -h                                 [9:38:58]
usage: catkin_create_pkg [-h] [--meta] [-s [SYS_DEPS [SYS_DEPS ...]]]
                         [-b [BOOST_COMPS [BOOST_COMPS ...]]] [-V PKG_VERSION]
                         [-D DESCRIPTION] [-l LICENSE] [-a AUTHOR]
                         [-m MAINTAINER] [--rosdistro ROSDISTRO]
                         name [dependencies [dependencies ...]]

Creates a new catkin package

positional arguments:
  name                  The name for the package
  dependencies          Catkin package Dependencies

optional arguments:
  -h, --help            show this help message and exit
  --meta                Creates meta-package files
  -s [SYS_DEPS [SYS_DEPS ...]], --sys-deps [SYS_DEPS [SYS_DEPS ...]]
                        System Dependencies
  -b [BOOST_COMPS [BOOST_COMPS ...]], --boost-comps [BOOST_COMPS [BOOST_COMPS ...]]
                        Boost Components
  -V PKG_VERSION, --pkg_version PKG_VERSION
                        Initial Package version
  -D DESCRIPTION, --description DESCRIPTION
                        Description
  -l LICENSE, --license LICENSE
                        Name for License, (e.g. BSD, MIT, GPLv3...)
  -a AUTHOR, --author AUTHOR
                        A single author, may be used multiple times
  -m MAINTAINER, --maintainer MAINTAINER
                        A single maintainer, may be used multiple times
  --rosdistro ROSDISTRO
                        The ROS distro (default: environment variable
                        ROS_DISTRO if defined)
shiyanlou:src/ $ catkin_create_pkg helloros roscpp                    [9:39:09]
Created file helloros/package.xml
Created file helloros/CMakeLists.txt
Created folder helloros/include/helloros
Created folder helloros/src
Successfully created files in /home/shiyanlou/Code/helloros/src/helloros. Please adjust the values in package.xml.
shiyanlou:src/ $ cd helloros/src                                      [9:40:06]
shiyanlou:src/ $ ls                                                   [9:41:00]
shiyanlou:src/ $ gedit helloros.cpp                                   [9:41:05]

(gedit:1618): GVFS-RemoteVolumeMonitor-WARNING **: remote volume monitor with dbus name org.gtk.vfs.UDisks2VolumeMonitor is not supported

(gedit:1618): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
shiyanlou:src/ $ ls                                                   [9:48:07]
helloros.cpp
shiyanlou:src/ $ cd ..                                                [9:48:11]
shiyanlou:helloros/ $ l                                               [9:48:14]
\u603b\u7528\u91cf 28K
drwxrwxr-x 4 shiyanlou shiyanlou 4.0K 3\u6708  25 09:47 .
drwxrwxr-x 3 shiyanlou shiyanlou 4.0K 3\u6708  25 09:40 ..
-rw-rw-r-- 1 shiyanlou shiyanlou 6.8K 3\u6708  25 09:47 CMakeLists.txt
drwxrwxr-x 3 shiyanlou shiyanlou 4.0K 3\u6708  25 09:40 include
-rw-rw-r-- 1 shiyanlou shiyanlou 2.6K 3\u6708  25 09:40 package.xml
drwxrwxr-x 2 shiyanlou shiyanlou 4.0K 3\u6708  25 09:44 src
shiyanlou:helloros/ $ cd ..                                           [9:48:16]
shiyanlou:src/ $ cd ..                                                [9:48:21]
shiyanlou:helloros/ $ catkin_make                                     [9:48:23]
Base path: /home/shiyanlou/Code/helloros
Source space: /home/shiyanlou/Code/helloros/src
Build space: /home/shiyanlou/Code/helloros/build
Devel space: /home/shiyanlou/Code/helloros/devel
Install space: /home/shiyanlou/Code/helloros/install
Creating symlink "/home/shiyanlou/Code/helloros/src/CMakeLists.txt" pointing to "/opt/ros/kinetic/share/catkin/cmake/toplevel.cmake"
####
#### Running command: "cmake /home/shiyanlou/Code/helloros/src -DCATKIN_DEVEL_PREFIX=/home/shiyanlou/Code/helloros/devel -DCMAKE_INSTALL_PREFIX=/home/shiyanlou/Code/helloros/install -G Unix Makefiles" in "/home/shiyanlou/Code/helloros/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/helloros/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/helloros/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 1 packages in topological order:
-- ~~  - helloros
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'helloros'
-- ==> add_subdirectory(helloros)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/shiyanlou/Code/helloros/build
####
#### Running command: "make -j4 -l4" in "/home/shiyanlou/Code/helloros/build"
####
Scanning dependencies of target helloros_node
[ 50%] Building CXX object helloros/CMakeFiles/helloros_node.dir/src/helloros.cpp.o
/home/shiyanlou/Code/helloros/src/helloros/src/helloros.cpp: In function \u2018int main(int, char**)\u2019:
/home/shiyanlou/Code/helloros/src/helloros/src/helloros.cpp:7:2: error: \u2018NodeHandlenh\u2019 is not a member of \u2018ros\u2019
  ros::NodeHandlenh;
  ^
helloros/CMakeFiles/helloros_node.dir/build.make:62: recipe for target 'helloros/CMakeFiles/helloros_node.dir/src/helloros.cpp.o' failed
make[2]: *** [helloros/CMakeFiles/helloros_node.dir/src/helloros.cpp.o] Error 1
CMakeFiles/Makefile2:907: recipe for target 'helloros/CMakeFiles/helloros_node.dir/all' failed
make[1]: *** [helloros/CMakeFiles/helloros_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
shiyanlou:helloros/ $ catkin_make                                     [9:48:42]
Base path: /home/shiyanlou/Code/helloros
Source space: /home/shiyanlou/Code/helloros/src
Build space: /home/shiyanlou/Code/helloros/build
Devel space: /home/shiyanlou/Code/helloros/devel
Install space: /home/shiyanlou/Code/helloros/install
####
#### Running command: "make cmake_check_build_system" in "/home/shiyanlou/Code/helloros/build"
####
####
#### Running command: "make -j4 -l4" in "/home/shiyanlou/Code/helloros/build"
####
Scanning dependencies of target helloros_node
[ 50%] Building CXX object helloros/CMakeFiles/helloros_node.dir/src/helloros.cpp.o
[100%] Linking CXX executable /home/shiyanlou/Code/helloros/devel/lib/helloros/helloros_node
[100%] Built target helloros_node
shiyanlou:helloros/ $ source devel/setup.zsh                          [9:49:29]
shiyanlou:helloros/ $ rosrun helloros helloros_node                   [9:49:50]
terminate called after throwing an instance of 'ros::InvalidNameException'
  what():  Character [ ] is not valid as the first character in Graph Resource Name [ hello_ros ].  Valid characters are a-z, A-Z, / and in some cases ~.
[1]    2109 abort (core dumped)  rosrun helloros helloros_node
shiyanlou:helloros/ $ rosrun helloros helloros_node                   [9:50:11]
terminate called after throwing an instance of 'ros::InvalidNameException'
  what():  Character [ ] is not valid as the first character in Graph Resource Name [ hello_ros ].  Valid characters are a-z, A-Z, / and in some cases ~.
[1]    2121 abort (core dumped)  rosrun helloros helloros_node
shiyanlou:helloros/ $ catkin_make                                     [9:50:27]
Base path: /home/shiyanlou/Code/helloros
Source space: /home/shiyanlou/Code/helloros/src
Build space: /home/shiyanlou/Code/helloros/build
Devel space: /home/shiyanlou/Code/helloros/devel
Install space: /home/shiyanlou/Code/helloros/install
####
#### Running command: "make cmake_check_build_system" in "/home/shiyanlou/Code/helloros/build"
####
####
#### Running command: "make -j4 -l4" in "/home/shiyanlou/Code/helloros/build"
####
Scanning dependencies of target helloros_node
[ 50%] Building CXX object helloros/CMakeFiles/helloros_node.dir/src/helloros.cpp.o
[100%] Linking CXX executable /home/shiyanlou/Code/helloros/devel/lib/helloros/helloros_node
[100%] Built target helloros_node
shiyanlou:helloros/ $ source devel/setup.zsh                          [9:51:22]
shiyanlou:helloros/ $ rosrun helloros helloros_node                   [9:51:33]
[ INFO] [1648173097.607466664]: Hello, ROS!
shiyanlou:helloros/ $ catkin_make                                     [9:51:37]
Base path: /home/shiyanlou/Code/helloros
Source space: /home/shiyanlou/Code/helloros/src
Build space: /home/shiyanlou/Code/helloros/build
Devel space: /home/shiyanlou/Code/helloros/devel
Install space: /home/shiyanlou/Code/helloros/install
####
#### Running command: "make cmake_check_build_system" in "/home/shiyanlou/Code/helloros/build"
####
####
#### Running command: "make -j4 -l4" in "/home/shiyanlou/Code/helloros/build"
####
Scanning dependencies of target helloros_node
[ 50%] Building CXX object helloros/CMakeFiles/helloros_node.dir/src/helloros.cpp.o
[100%] Linking CXX executable /home/shiyanlou/Code/helloros/devel/lib/helloros/helloros_node
[100%] Built target helloros_node
shiyanlou:helloros/ $ rosrun helloros helloros_node                   [9:52:34]
[ INFO] [1648173164.205589203]: Hello nihao, ROS!
shiyanlou:helloros/ $                                                 [9:52:44]
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
shiyanlou:~/ $ history                                               [11:37:17]
    1  git clone https://gitcode.net/ZhangRelay/v-rep_pro_edu_v3_6_2_ubuntu16_04.git
    2  tar
    3  tar --help
    4  tar --usage
    5  tar -xf v-rep_pro_edu_v3_6_2_ubuntu16_04/V-REP_PRO_EDU_V3_6_2_Ubuntu16_04.tar.xz
    6  cd V-REP_PRO_EDU_V3_6_2_Ubuntu16_04
    7  ls
    8  gedit vrep.sh
    9  vrep.sh
   10  ./vrep.sh
   11  roscore
   12  rosrun turtlesim turtlesim_node
   13  rosrun turtlesim turtle_teleop_key
   14  rosrun turtlesim turtlesim_node
   15  rospack list
   16  catkin_create_pkg 
   17  catkin_create_pkg -h
   18  catkin_create_pkg helloros
   19  catkin_create_pkg -h
   20  catkin_create_pkg helloros roscpp
   21  cd helloros/src
   22  ls
   23  gedit helloros.cpp 
   24  ls
   25  cd ..
   26  l
   27  cd ..
   28  catkin_make
   29  source devel/setup.zsh
   30  roscore
   31  rosrun helloros helloros_node
   32  catkin_make
   33  source devel/setup.zsh
   34  rosrun helloros helloros_node
   35  catkin_make
   36  rosrun helloros helloros_node
shiyanlou:~/ $                                                       [11:37:20]
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-03-25,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
[ros][ubuntu]ros在ubuntu18.04上工作空间创建和发布一个话题
 echo "source ~/catkin_ws/devel/setup.bash" >>  ~/.bashrc  source ~/.bashrc
云未归来
2025/07/17
990
[ros][ubuntu]ros在ubuntu18.04上工作空间创建和发布一个话题
蓝桥ROS机器人课程之无限扩展∞∞∞(程序设计案例)
学习知识,非常重要,但是掌握高效率发现问题,分析问题,解决问题一整套思路更加重要。
zhangrelay
2022/05/01
5490
蓝桥ROS机器人课程之无限扩展∞∞∞(程序设计案例)
【C++】ROS:cv_bridge包使用与图像转换示例
cv_bridge是一个用于在ROS(Robot Operating System)和OpenCV之间进行图像转换的库。它提供了方便的接口和功能,用于在ROS中将ROS图像消息(sensor_msgs/Image)与OpenCV图像格式之间进行相互转换。
DevFrank
2024/07/24
8980
ROS学习——第1讲 ROS概述及环境搭建
好事文章地址:https://cloud.tencent.com/developer/article/2469534
Arya
2024/11/22
7950
ROS学习——第1讲 ROS概述及环境搭建
ROS入门篇
ROS是一个松耦合的分布式软件框架。上图中有很多的Node(节点),每个节点是在机器人系统中完成一个具体功能的进程,比方说有的Node是完成图像识别,有的Node是完成一个图像的驱动,它们之间会有一系列图像的传输。节点与节点之间位置也不是固定的,比如上图中有两台电脑,一个A,一个B,有些节点可以在A当中,有些节点可以在B当中,它们之间可以通过一系列的传输方式来完成通讯。每个节点的编程语言也不是固定的,可以使用Python,也可以使用C++。
算法之名
2023/10/16
2.4K0
ROS入门篇
ros节点(node)与包(package) 话题与消息的介绍
[catkin_create_pkg my_robot roscpp rospy std_msgs]在src目录中创建一个名为CMakeLists.txt的文件,该文件包含用于构建你的包的CMake指令
无暇
2023/09/16
5441
蓝桥ROS机器人之古月居ROS入门21讲
ROS1入门经典课程,在其官网和B站等都有详细介绍和视频讲解。 古月居校园行 直接在蓝桥云课下载就可以学习和使用啦。 文档部分: 源码等: 将源码复制到demo_ws/src下,并编译后使
zhangrelay
2022/05/01
7710
蓝桥ROS机器人之古月居ROS入门21讲
ROS编程(ETH)2018更新版习题说明(二)
- ROS包结构 - 使用Eclipse进行集成化编程 - ROS C++客户端库(roscpp) - ROS订阅者和发布者 - ROS参数服务器
zhangrelay
2019/01/23
6860
机器人操作系统ROS学习实战篇之——让小乌龟画矩形
之前,在ROS的安装过程中,我们执行了如下命令:(此命令就是向当前用户添加ROS的环境变量)
用户1696846
2019/12/30
2.8K0
机器人操作系统ROS学习实战篇之——让小乌龟画矩形
ROS1/2机器人之从命令调用到程序编写
大多数 ROS1 节点在启动时连接到节点管理器上,如果运行中连接中断,则不会尝试重新连接。因此,如果 roscore 被终止,当前运行的其他节点将无法建立新的连接,即使 稍后重启 roscore 也无济于事。
zhangrelay
2022/05/01
8240
ROS1/2机器人之从命令调用到程序编写
2.ROS基础-ROS通信编程
程序逻辑: 1.头文件 2.ROS节点初始化,前两个参数和main()函数参数一致,最后一个参数定义节点名称。 3.创建节点句柄 比较方便的去管理节点的资源,比如发布者、订阅者、一些话题之类的 4.创建发布者,代码中1000为队列长度 5.设置循环频率,例如10hz,循环100ms 6.开始循环
小飞侠xp
2019/03/15
1.6K0
2.ROS基础-ROS通信编程
蓝桥ROS之f1tenth案例学习与调试(失败)
在蓝桥云课ROS中测试一下是否可行(kinetic/melodic/noetic):
zhangrelay
2022/05/10
5700
蓝桥ROS之f1tenth案例学习与调试(失败)
ROS2机器人编程简述humble-第二章-DEVELOPING THE FIRST NODE .2
0.1ROS2机器人编程简述新书推荐-A Concise Introduction to Robot Programming with ROS2
zhangrelay
2023/02/03
6400
蓝桥ROS之f1tenth案例学习与调试(成功)
失败案例: 蓝桥ROS之f1tenth案例学习与调试(失败) ---- 其实这个版本是适用于kinetic/melodic/noetic 为何失败呢? 需要将kinetic功能包全部更新到20210503版本!!! 然后编译就一切ok! shiyanlou:f1tenth/ (master*) $ catkin_make [15:07:45] Base path: /home/shiyanlou/Code/f1tenth Source space: /
zhangrelay
2022/05/10
2070
蓝桥ROS之f1tenth案例学习与调试(成功)
ROS Beginner(长文预警!
参考网站:http://wiki.ros.org/cn/ROS/Tutorials
From Zero
2021/12/07
1K0
蓝桥ROS机器人之ROS程序和普通程序以及APP/API等
有个问题记录一下: ROS程序和普通程序有什么区别? 什么是ROS应用?什么是ROS接口? 第一个问题,本质上没有区别的。 使用上有一些区别罢了。 第二个问题,pub或sub都支持很多模式,自己写个聊天工具都不难的。 命令行接口查看 图形化接口查看  当然直接写个sub也行的。 这里直接在云课中使用古月居21讲内容。 推荐学生阅读(2019年左右一篇文章): 互联网下半场:从超级入口到超级接口,从超级APP到超级API shiyanlou:~/ $ history
zhangrelay
2022/05/01
3270
蓝桥ROS机器人之ROS程序和普通程序以及APP/API等
ROS学习之路之发布订阅通信(一)
首先ROS是有官网教程的:http://wiki.ros.org/cn/ROS/Tutorials
用户5908113
2023/11/17
3280
ROS学习之路之发布订阅通信(一)
ROS(indigo)RRT路径规划
源码地址:https://github.com/nalin1096/path_planning
zhangrelay
2019/01/23
1.9K0
Cpp ROS(一)发布器Publisher和订阅器Subscriber简单例子
创建完成以后,在目录my_node_demo下多出两个文件(package.xml ,CMakeLists.txt)和两个文件夹(src, include)。
Autooooooo
2020/11/09
1.1K0
Cpp ROS(一)发布器Publisher和订阅器Subscriber简单例子
ROS编译 Python 文件(详细说明)
参考自:http://wiki.ros.org/rospy_tutorials/Tutorials/Makefile
全栈程序员站长
2021/04/07
2.4K0
推荐阅读
相关推荐
[ros][ubuntu]ros在ubuntu18.04上工作空间创建和发布一个话题
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档