3 #include <boost/algorithm/string.hpp> 4 #include <boost/serialization/serialization.hpp> 5 #include <boost/utility/string_ref.hpp> 6 #include <geometry_msgs/Pose.h> 7 #include <sensor_msgs/JointState.h> 14 #include <benchmark/benchmark.h> 21 static std::vector<SubstitutionRule>
Rules()
23 std::vector<SubstitutionRule> rules;
27 "transforms.#.header.frame_id",
31 "transforms.#.header.frame_id",
32 "transforms.#.header" ));
54 sensor_msgs::JointState js_msg;
56 js_msg.name.resize(6);
57 js_msg.position.resize(6);
58 js_msg.velocity.resize(6);
59 js_msg.effort.resize(6);
61 const char* suffix[6] = {
"_A",
"_B",
"_C",
"_D" ,
"_E",
"_F"};
63 for (
size_t i=0;
i< js_msg.name.size() ;
i++)
65 js_msg.header.seq = 100+
i;
66 js_msg.header.stamp.sec = 1234;
67 js_msg.header.frame_id = std::string(
"frame").append(suffix[
i]);
69 js_msg.name[i] = std::string(
"child").append(suffix[i]);
70 js_msg.position[i] = 10 +i;
71 js_msg.velocity[i] = 20 +i;
72 js_msg.effort[i] = 30 +i;
82 while (state.KeepRunning())
static void write(Stream &stream, typename boost::call_traits< T >::param_type t)
RosIntrospection::Parser parser
void applyNameTransform(const std::string &msg_identifier, const FlatMessage &container, RenamedValues *renamed_value)
static std::vector< SubstitutionRule > Rules()
static void BM_Joints(benchmark::State &state)
bool deserializeIntoFlatContainer(const std::string &msg_identifier, absl::Span< uint8_t > buffer, FlatMessage *flat_container_output, const uint32_t max_array_size) const
FlatMessage flat_container
uint32_t serializationLength(const T &t)
std::vector< std::pair< std::string, Variant > > RenamedValues
ros::serialization::OStream stream(buffer.data(), buffer.size())
std::vector< uint8_t > buffer(ros::serialization::serializationLength(imu))
void registerRenamingRules(const ROSType &type, const std::vector< SubstitutionRule > &rules)
void registerMessageDefinition(const std::string &message_identifier, const ROSType &main_type, const std::string &definition)