当前位置:网站首页>Nodehandle common member functions
Nodehandle common member functions
2022-06-25 08:16:00 【N1CROWN】
NodeHandle Common member functions include :
To create a topic publisher
ros::Publisher advertise(const string &topic,uint32_t queue_size, bool latch=false);
// The first parameter is the name of the publishing topic
// The second is the maximum length of the message queue , If the published message exceeds this length and is not received , Then the news will be out of the team . It is usually set as a
A smaller number is enough .
// The third parameter is whether to latch . Some topics are not published at a certain frequency , such as /map This topic, Only for initial subscription or map update
Under different circumstances ,/map Will release the news . The latch is used here .To create a topic subscriber
ros::Subscriber subscribe(const string &topic,uint32_t queue_size, void(*)(M));
// The first parameter is the name of the subscription topic
// The second parameter is the length of the subscription queue , If the received message is not handled in time , So new news joins the team , As soon as the news comes out
// The third parameter is the callback function pointer , Point to the callback function to process the received messageService creation server, Provide services
ros::ServiceServer advertiseService(const string &service, bool(*srv_func)(Mreq &, Mres &));
// The first parameter is service name
// The second parameter is the pointer to the service function , Point to the service function . The function pointed to should have two arguments , Accept requests and responses separately .Service creation client
ros::ServiceClient serviceClient(const string&service_name, bool persistent=false);
// The first functional expression service name
// The second parameter is used to set whether the service connection lasts , If true,client Will remain connected to the remote host , This will make subsequent requests faster . Usually we set flaseQuery the value of a parameter
bool getParam(const string &key, std::string &s);
boolgetParam (const std::string &key, double &d) const;
bool getParam(const std::string &key, int &i) const;
// Get... From the parameter server key Corresponding value , Multiple types have been overloadedAssign parameters
void setParam (const std::string &key, const std::string &s)const;
void setParam (const std::string &key, const char *s) const;
void setParam (const std::string &key, int i) const;
// to key Corresponding val assignment , Overloaded multiple types of val
边栏推荐
- Biweekly investment and financial report: capital ambush Web3 infrastructure
- 現在通過開戶經理發的開戶鏈接股票開戶安全嗎?
- Luogu p3313 [sdoi2014] travel (tree chain + edge weight transfer point weight)
- Authority design of SaaS system based on RBAC
- 电子学:第010课——实验 8:继电振荡器
- Looking for b-end product manager after years? I almost ruined myself
- A solution to slow startup of Anaconda navigator
- 洛谷P3313 [SDOI2014]旅行(树链+边权转点权)
- Electronics: Lesson 011 - experiment 10: transistor switches
- Solving some interesting problems with recurrence of function
猜你喜欢
Use pytorch to build mobilenetv2 and learn and train based on migration
Daily question brushing record (III)
Quickly build a real-time face mask detection system in five minutes (opencv+paddlehub with source code)
leetcode.13 --- 罗马数字转整数
Remove headers from some pages in a word document
c#ColorDialog更改文本颜色和FontDialog更改文本字体的使用示例
每日刷题记录 (三)
Talk about the future of cloud native database
A solution to slow startup of Anaconda navigator
Electronics: Lesson 010 - Experiment 9: time and capacitors
随机推荐
Websocket understanding and application scenarios
The first game of 2021 ICPC online game
初体验完全托管型图数据库 Amazon Neptune
Bat start NET Core
Free SSL certificate acquisition tutorial
Electronics: Lesson 010 - Experiment 9: time and capacitors
Matlab代码格式一键美化神器
allgero报错:Program has encountered a problem and must exit. The design will be saved as a .SAV file
Niuke: flight route (layered map + shortest path)
双周投融报:资本埋伏Web3基础设施
c#ColorDialog更改文本颜色和FontDialog更改文本字体的使用示例
What is the difference between agreement and service?
Socket problem record
Apache CouchDB Code Execution Vulnerability (cve-2022-24706) batch POC
电子学:第008课——实验 6:非常简单的开关
Deep learning series 45: overview of image restoration
Est - il sûr d'ouvrir un compte d'actions maintenant via le lien d'ouverture de compte coiffé?
[supplementary question] 2021 Niuke summer multi school training camp 6-n
Logu P2486 [sdoi2011] coloring (tree chain + segment tree + merging of intervals on the tree)
Almost taken away by this wave of handler interview cannons~