34 #include "gsdf_msgs/CommPacket.h" 35 #include "gsdf_msgs/BlackBoardPut.h" 36 #include "gsdf_msgs/BlackBoardQuery.h" 37 #include "gsdf_msgs/BlackBoardAck.h" 96 void put(
const std::string& key,
const Type& data)
101 rth_->insertOrUpdateBlackBoard(
bb_id_, key, s, timestamp,
rth_->getRobotID());
104 gsdf_msgs::BlackBoardPut bbp;
109 bbp.timestamp = timestamp;
110 bbp.robot_id =
rth_->getRobotID();
113 gsdf_msgs::CommPacket p;
114 p.header.source =
rth_->getRobotID();
116 p.header.data_len = bbp_vec.size();
117 p.header.version = 1;
118 p.header.checksum = 0;
119 p.content.buf = bbp_vec;
121 mqm_->getOutMsgQueue(
"bb")->push(msg_data);
125 Type
get(
const std::string& key)
132 std::cout <<
"ID " <<
bb_id_ <<
" blackboard, " << key <<
" is not exist." << std::endl;
136 Type data = deserialize_ros<Type>(bb.
bb_value);
140 gsdf_msgs::BlackBoardQuery bbq;
148 gsdf_msgs::CommPacket p;
149 p.header.source =
rth_->getRobotID();
151 p.header.data_len = bbq_vec.size();
152 p.header.version = 1;
153 p.header.checksum = 0;
154 p.content.buf = bbq_vec;
159 std::vector<uint8_t> empty_vec;
161 rth_->insertOrUpdateBlackBoard(
bb_id_, key, empty_vec, timestamp, -1);
163 mqm_->getOutMsgQueue(
"bb")->push(msg_data);
172 data = deserialize_ros<Type>(bbt.
bb_value);
boost::shared_ptr< RuntimeHandle > rth_
BlackBoard(int bb_id, int on_robot_id)
void put(const std::string &key, const Type &data)
BlackBoard & operator=(const BlackBoard &bb)
std::vector< uint8_t > serialize_ros(T t)
static boost::shared_ptr< T > getSingleton()
boost::shared_ptr< micros_swarm::MsgQueueManager > mqm_
BlackBoard(const BlackBoard &bb)
std::vector< uint8_t > bb_value
ROSCPP_DECL void spinOnce()