1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ROS C++ でサービスの書き方

Posted at

#クライアントの書き方
##Emptyで宣言する場合

ヘッダーファイルの宣言

#include <std_srvs/Empty.h>

関数内での記述

ros::NodeHandle nh;
ros::ServiceClient client = nh.serviseClient<std_srvs::Empty>("pkg名(例:imu/set_zero_orientation)"); //サービスのクライアント宣言
std_srvs::Empty srv;  //

client.call(srv);  //サービスを配信する

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?