ROS study manual - [1] Actionlib use

Actionlib ROS is very important to the library, like the implementation of a variety of sports action, such as the control arm to grab a cup, a process that can be complex and lengthy, the implementation process may also be forced to interrupt or feedback, then you can Actionlib Exhibition a hand. 1. Principle 1.1 function in any of a large ROS based system, there will be such a case, a node sends a request to execute one of the tasks, and returns the corresponding results of this usually ROS services (Services) carry out. However, there are some cases service execution time is very long, you want to get the progress of task processing, or may cancel the execution of tasks in execution, Actionlib will be able to achieve this function, it is a very important library of ROS. You can achieve some simple state machine functions, counted on a weakened version of SMACH. Node: ## typedef description of the syntax: typedef Type Name Type Identifier; ## typedef Usage: 1) is defined as a new type of basic data type name. 2) for the custom data types (structures, public bodies and enumerated types) defined simple type name. 3) to define an array of simple type name. 4) pointer defined name for brevity. ## typedef Note the use of: 1) typedef purpose is to add a new name for the known data types. Thus does not introduce a new data type. 2) typedef adapted only defined type names, not suitable for defining a variable. 3) typedef and #define similar place, but the essence of difference. ## typedef and define specific detailed distinction 1) #define pretreatment command performs simple substitution When the preprocessor, is not checked for correctness, if none of the meaning correctly into the still, has been expanded only at compile source It will detect possible errors and error program. For example: #define PI 3.1415926 program: area = PI * r * r 3 is replaced. 1415926 * r * r If you use numbers #define statement of 9 g pre-written letter also still into. 2) typedef is treated at compile time. It is a type alias in its scope to one that already exists, but You can not use the typedef specifier insidea function definition. 3) typedef int * int_ptr with #define int_ptr int * are used INT_PTR acting on behalf int *, but the two differ, as said front, # define simple pretreatment replaced, rather than simply typedef Alternatively, but a method as defined using the variables declared as a type. That; Reference: https://www.cnblogs.com/cv-pr/p/6005013.html https://www.cnblogs.com/seventhsaint/archive/2012/11/18/2805660.html

Guess you like

Origin www.cnblogs.com/Way-cn/p/11605060.html