ROS学习手记 - 7 创建ROS msg & srv

至此,我们初步学习了ROS的基本工具,接下来一步步理解ROS的各个工作部件的创建和工作原理。 本文的详细文档:http://wenku.baidu.com/view/623f41b3376baf1ffd4fad7a Creating a ROS msg and srv This tutorial covers how to create and build msg and srv files as well as therosmsg, rossrv and roscp commandline tools. 1. msg & srv 文件介绍     msg 文件 就是用来让不同语言能产生message的一个指导性文本文件。     srv file describes a service. It is composed of two parts: a request and a response. 2. msg & srv 文件存储位置:     <workspace>/packagename/msg/     &     <workspace>/packagename/srv/     ==== msg file 说明 ==== 3. msgfile 的格式和生成     生成:          $ cd ~/catkin_ws/src/beginner_tutorials

READ MORE

ROS学习手记 - 6 使用ROS中的工具:rqt_console &amp; roslaunch &amp; rosed

http://wiki.ros.org/ROS/Tutorials/UsingRqtconsoleRoslaunch Using rqt_console and roslaunch This tutorial introduces ROS using rqt_console and rqt_logger_level for debugging and roslaunch for starting many nodes at once. If you use ROS fuerte or ealier distros whererqt isn't fully available, please see this page withthis page that uses old rx based tools.                     rqt console工具的打开: Using rqt_console and rqt_logger_level rqt_console attaches to ROS's logging framework to display output from nodes.rqt_logger_level allows us to change the verbosity level (DEBUG, WARN, INFO, and ERROR) of nodes as they run.

READ MORE

ROS学习手记 - 5 理解ROS中的基本概念_Services and Parameters

上一节完成了对nodes, Topic的理解,再深入一步: Services and Parameters 我不理解为何 ROS wiki 要把service与parameter放在一起介绍, 很想分开说,但限于 csdn blog 没有文章顺序调整功能。只能罢了~~ -----------------以下是我作的关于ROS Service的总结------------------- 关于ROS Service的总结: 什么是ROS Service: 在wiki/tutorials/1.7 中,有“Understanding ROS Services and Parameters”一节, 我不理解为何要把service与parameter放在一起介绍。 [概念concepts] ROS Service: Another way that Nodes communicate with nodes. A_node send a request to B_node, and B_node give a response. [命令Commands] sorservice list/call/type/find/uri    &   rossrv - this command is mainly for the .srv files operations 什么定义了ROS Service: *.srv file - srv文件: 在wiki/tutorials/1.10  中,有“Creating Msg & Srv” 一节,我还是没理解为何要把srv文件和msg文件放在一起介绍。 The function of srv file: Discribe/define the data type for a service.

READ MORE

ROS学习手记 - 4 理解ROS中的基本概念_ROS_Topics

ROS学习手记 - 4 理解ROS中的基本概念_ROS_Topics 参考步骤:http://wiki.ros.org/ROS/Tutorials/UnderstandingTopics Understanding ROS’s Topics This tutorial introduces ROS topics as well as using therostopic andrqt_plot commandline tools. 复习一下教程里关于Topic的解释: 1. 准备工作 确认运行roscore之后,开始我们的turtlesim之旅 2. 用rosrun开了两个node, 一个是显示turtlesim窗口的turtlesim turtlesim_node $ rosrun turtlesim turtlesim_node 一个是接收用户keyboard指令的turtlesim turtle_teleop_key $ rosrun turtlesim turtle_teleop_key 3. rqt_graph工具 turtle_teleop_key是publisher,turtlesim_node是listener,用rqt_graph来看当前运行的nodes&topics. 用rqt_graph工具图形化地查看当前的node和topic运行状态,主从关系等。 $ rosrun rqt_graph rqt_graph 4. 使用rostopic工具分析topic相关信息 $rostopic -h //查看说明 4.1 使用rostopic echo打印发送在topic上的数据 rostopic echo shows the data published on a topic. rostopic echo [topic] 4.2 使用rostopic list查看当前的topic是从属于谁,又领导谁 $ rostopic list -h //查看说明 4.3 使用rostopic hz 显示topic发布的频率 Usage: rostopic hz [topic]

READ MORE

ROS学习手记 - 3 理解ROS中的基本概念_ROS_Nodes

ROS学习手记 - 3 理解ROS中的基本概念_ROS_Nodes 在上次我们完成了一趟简单的package的Create,Build之后,我们要玩正儿八经的ROS,在此之前,我们有很多概念需要理解。按照如下列表进展。 Understanding ROS Nodes This tutorial introduces ROS graph concepts and discusses the use ofroscore,rosnode, androsrun commandline tools. Understanding ROS Topics This tutorial introduces ROS topics as well as using therostopic andrqt_plot commandline tools. Understanding ROS Services and Parameters This tutorial introduces ROS services, and parameters as well as using therosservice androsparam commandline tools. Understanding ROS Nodes roscore,rosnode, androsrun commandline tools This tutorial introduces ROS graph concepts and discusses the use of roscore, rosnode, androsrun commandline tools.

READ MORE

ROS学习手记 - 2 Create and Build ROS Package 生成包(C++)

ROS学习手记 - 2 Create and Build ROS Package 生成包(C++) For ROS experienced user, You can just skip to the Constuction about ROS Package usage: For Quick Reference(C++): http://blog.csdn.net/sonictl/article/details/46764855#t5 For Quick Reference(Python): http://blog.csdn.net/sonictl/article/details/46764855#t15 === 在上一篇的基础上,Create并Customize了Package之后,要Build Package === 来源:http://wiki.ros.org/ROS/Tutorials/BuildingPackages 1. 确认source有没有完成 (版本: hydro): $ source /opt/ros/hydro/setup.bash 2. Using catkin_make 使用方法: # In a catkin workspace $ catkin_make [make_targets] [-DCMAKE_VARIABLES=...] 这里catkin_make使用了CMake 的workflow来操作,科普一下这个workflow: 3. 如何写ROS的Publisher and Subscriber(C++) 因为要涉及到对CMakeLists.txt的写法,需要先了解这个文章:http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29 具体关于CMakeLists.txt文件,请看http://wiki.ros.org/catkin/CMakeLists.txt 4. 关于workspace下的build devel src文件夹 The build folder is the default location of thebuild space and is wherecmake andmake are called to configure and build your packages.

READ MORE

ROS学习手记 - 1了解并安装ROS+创建ROS_Package

ROS学习手记 - 1了解并安装ROS+创建ROS_Package ROS学习手记: 开始之前: 先看了 《认识ROS操作系统(2015版)》,了解了ROS的基本概念。 这里补充一点ROS的发展历程,以便了解catkin的由来,及willow garage公司与ROS的关系: ROS was originally developed in 2007 under the name switchyard by the Stanford Artificial Intelligence Laboratory in support of the Stanford AI Robot STAIR (STanford AI Robot) [6][7] project.From 2008 until 2013, development was performed primarily at Willow Garage, a robotics research institute/incubator. During that time, researchers at more than twenty institutions collaborated with Willow Garage engineers in a federated development model.[8][9] In February 2013, ROS stewardship transitioned to the Open Source Robotics Foundation.

READ MORE

VS2010 C++ MFC框架学习笔记5 - C++面向对象编程基础1

VS2010 C++ MFC框架学习笔记5 - C++面向对象编程基础1 时隔一周多,再继续C++之路。 1. MSG结构体 Windows应用程序响应操作系统的消息,通过MSG结构体传达消息信息: 2. 消息队列 Windows消息队列,被应用程序逐条响应 注意2点: 1. 消息——用户操作、程序状态 2. 消息响应 3. WinMain函数——VC++的入口函数 int CALLBACK WinMain( _In_ HINSTANCE hInstance,//实例的句柄,标识这个当前运行的实例 _In_ HINSTANCE hPrevInstance, //实例的句柄,标识previous运行的实例 _In_ LPSTR lpCmdLine, //LongPointer_String 长指针,指向一个String , 运行程序时,传入的命令行参数。ARGC ARGV _In_ int nCmdShow //指定窗口显示时的状态(最大化、适中、隐藏。。。) ); 4. 窗口应用程序的创建步骤 设计一个窗口类 注册窗口 创建窗口 显示及更新窗口 typedef struct tagWNDCLASS { UINT style; //Style这里是窗口类型,见上面的解释 WNDPROC lpfnWndProc; //窗口过程函数的指针,用这个函数来处理相应的消息 int cbClsExtra; //分配的额外的内存空间,通常称为类的附加内存 int cbWndExtra; //窗口的附加内存 HINSTANCE hInstance; // = hInstance HICON hIcon; //图标句柄wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION); HCURSOR hCursor; //光标句柄wndclass.hCursor=LoadCursor(NULL,IDC_CROSS); HBRUSH hbrBackground; //窗口背景被这个参数控制 //画刷的句柄wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH); LPCTSTR lpszMenuName; //长指针常量String,用来设定菜单的名字,NULL LPCTSTR lpszClassName; //常量字符串,设定类的名字。"weixin",创建窗口时,名字要与其一致,否则创建不出窗口 } WNDCLASS, *PWNDCLASS; 怎么使用:

READ MORE

VS2010 C++ MFC框架学习笔记4 - C++面向对象编程基础2

VS2010 C++ MFC框架学习笔记4 - C++面向对象编程基础2 跟着教材《Visual C++ 2010 MFC 编程入门》.pdf 学习了2周,感觉有些基础的概念不太清楚,所以找出网易学堂的VC++课程进行学习http://tech.163.com/special/0009159F/vc.html =========================================== [第二课 C++经典语法与应用 类的编写与应用] =========================================== 构造函数:采用类的方式来保证它的唯一性,取个类名,没有返回值,对类里的变量进行初始化。 析构函数:回收内存,没有返回,没有参数。 例: 1. #include<iostream> 2. using namespace std; 3. class Point{ 4. public: 5. int x; 6. int y; 7. Point(){ //构造函数,同,类名 8. x = 0; 9. y = 0; 10. } 11. 12. Point(int a, int b){ //构造函数,带参 13. x = a; y = b; 14. } 15. 16. ~Point(){ //析构函数,取反符号+类名 17. } 18. 19. void output(){ 20. cout<<x<<endl<<y<<endl; 21. } 22. void output(int x, int y){ 23.

READ MORE