ROSでmp3ファイルを再生できるmp3_playerノードを作成しています。
gx_sound_playerを利用したいを考えています。
cpp
1/* 2 * mp3_player.h 3*/ 4#ifndef MP3_PLAYER_H 5#define MP3_PLAYER_H 6 7#include <ros/ros.h> 8#include <actionlib/client/simple_action_client.h> 9#include "gx_sound_msgs/SoundRequestAction.h" 10#include "gx_sound_msgs/SoundRequestGoal.h" 11 12 13class mp3Player{ 14public: 15 mp3Player(); 16 17private: 18 actionlib::SimpleActionClient<gx_sound_msgs::SoundRequestAction> ac("SoundRequestAction", true); 19 20}; 21 22#endif
このようにmp3_player.h内でアクションクライアントを宣言して、
mp3_player.cpp内でいちいち宣言し直さないで使いまわしたいと考えているのですが
error: expected identifier before string constant actionlib::SimpleActionClient<gx_sound_msgs::SoundRequestAction> ac("SoundRequestAction", true); error: expected ‘,’ or ‘...’ before string constant
というようなエラーが出てしまいます。
打ち間違いがあるようなエラーですが、わかりません
アクションクライアントはmain関数で宣言してループの中で使うしかないのでしょうか
Ubuntu16.04
ROS Kinetic
あなたの回答
tips
プレビュー