-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsg_decoder.h
58 lines (53 loc) · 1.29 KB
/
msg_decoder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
// c++
// http://www.cplusplus.com/reference/
//#include <algorithm>
#include <chrono>
#include <memory>
#include <string>
//#include <tuple>
#include <atomic>
#include <mutex>
#include <thread>
#include <unordered_map>
//#include <codecvt>
//#include <complex>
//#include <exception>
#include <functional>
//#include <initializer_list>
//#include <iterator>
//#include <limits>
//#include <locale>
//#include <new>
//#include <numeric>
//#include <random>
//#include <ratio>
//#include <regex>
//#include <stdexcept>
//#include <system_error>
//#include <typeindex>
//#include <typeinfo>
//#include <type_traits>
//#include <utility>
//#include <valarray>
//#include <condition_variable>
//#include <future>
#include <iostream>
#include "boost/bind.hpp"
#include "string.h"
#include <jsoncpp/json/json.h>
namespace ros_bridge_client
{
inline void decodeCmdVel(Json::Value &msg, float &velocity, float &angular)
{
velocity = msg["velocity"].asFloat();
angular = msg["angular"].asFloat();
}
inline void decodeGoalPose(Json::Value &msg, float &x, float &y, float &theta, std::string &frame_id)
{
x = msg["x"].asFloat();
y = msg["y"].asFloat();
theta = msg["theta"].asFloat();
frame_id = msg["header"]["frame_id"].asString();
}
}