14#include <unordered_map>
124 std::function<
void(
int ,
const char * ,
int ,
const std::string & )>
136 int connect(
const std::string &ip =
"",
int port = 0);
163 int login(
const std::string &usrname,
const std::string &passwd);
222 int setTopic(
bool to_server,
const std::vector<std::string> &names,
double freq,
int expected_chanel);
288#define RtdeClient_DECLARES \
289 _FUNC(RtdeClient, 1, setLogHandler, handler) \
290 _FUNC(RtdeClient, 2, connect, ip, port) \
291 _FUNC(RtdeClient, 0, disconnect) \
292 _FUNC(RtdeClient, 0, hasConnected) \
293 _FUNC(RtdeClient, 1, hasConnected1, callback) \
294 _FUNC(RtdeClient, 2, login, usrname, passwd) \
295 _FUNC(RtdeClient, 0, logout) \
296 _FUNC(RtdeClient, 0, hasLogined) \
297 _FUNC(RtdeClient, 0, getProtocolVersion) \
298 _FUNC(RtdeClient, 0, getInputMaps) \
299 _FUNC(RtdeClient, 0, getOutputMaps) \
300 _FUNC(RtdeClient, 4, setTopic, to_server, names, freq, expected_chanel) \
301 _FUNC(RtdeClient, 2, removeTopic, to_server, chanel) \
302 _FUNC(RtdeClient, 0, getRegisteredInputRecipe) \
303 _FUNC(RtdeClient, 0, getRegisteredOutputRecipe) \
304 _FUNC(RtdeClient, 2, subscribe, chanel, callback) \
305 _FUNC(RtdeClient, 2, publish, chanel, callback) \
306 _FUNC(RtdeClient, 1, setEventHandler, cb)
OutputBuilder & push(double val)
OutputBuilder & push(int16_t &val)
OutputBuilder & push(const std::vector< double > &val)
OutputBuilder & push(int val)
OutputBuilder & push(const std::string &val)
OutputBuilder & push(char val)
OutputBuilder & push(const std::vector< int > &val)
OutputBuilder & push(const std::vector< int16_t > &val)
OutputBuilder & push(const agvc_interface::RtdeRecipe &val)
OutputBuilder & push(const std::tuple< int, bool > &val)
std::unordered_map< int, agvc_interface::RtdeRecipe > getRegisteredOutputRecipe()
获取已注册的输出菜单
int removeTopic(bool to_server, int chanel)
取消订阅
bool hasConnected() const
socket 是否已连接
int setTopic(bool to_server, const std::vector< std::string > &names, double freq, int expected_chanel)
设置话题
int connect(const std::string &ip="", int port=0)
连接到服务器
std::unordered_map< int, agvc_interface::RtdeRecipe > getRegisteredInputRecipe()
获取已注册的输入菜单
std::map< std::string, int > getInputMaps()
获取输入列表
int login(const std::string &usrname, const std::string &passwd)
登录
int subscribe(int chanel, std::function< void(InputParser &)> callback)
订阅 subscribe from output
bool hasConnected1(std::function< void(bool)> callback)
socket 是否已连接
int setEventHandler(std::function< void(int)> cb)
设置事件处理
RtdeClient(int mode=0)
RTDE客户端初始化
int getProtocolVersion()
获取协议版本号
std::map< std::string, int > getOutputMaps()
获取输出列表
void setLogHandler(std::function< void(int, const char *, int, const std::string &)> handler)
设置日志处理器
int publish(int chanel, std::function< void(OutputBuilder &)> callback)
发布 publish to input
std::shared_ptr< RtdeClient > RtdeClientPtr