44 int main(
int argc,
char** argv)
46 ros::init(argc, argv,
"evaluate_state_operations_speed");
54 robot_model::RobotModelConstPtr robot_model = rml.
getModel();
57 static const int N = 10000;
58 robot_state::RobotState state(robot_model);
60 printf(
"Evaluating model '%s' using %d trials for each test\n", robot_model->getName().c_str(), N);
65 printf(
"Evaluating FK Default ...\n");
66 for (
int i = 0; i < N; ++i)
69 state.setToDefaultValues();
74 printf(
"Evaluating FK Random ...\n");
75 for (
int i = 0; i < N; ++i)
78 state.setToRandomPositions();
83 std::vector<robot_state::RobotState*> copies(N, (robot_state::RobotState*)NULL);
84 printf(
"Evaluating Copy State ...\n");
85 for (
int i = 0; i < N; ++i)
88 copies[i] =
new robot_state::RobotState(state);
92 printf(
"Evaluating Free State ...\n");
93 for (
int i = 0; i < N; ++i)
100 const std::vector<std::string>& groups = robot_model->getJointModelGroupNames();
101 for (std::size_t j = 0; j < groups.size(); ++j)
104 const robot_model::JointModelGroup* jmg = robot_model->getJointModelGroup(groups[j]);
106 printf(
"%s: Evaluating FK Random ...\n", groups[j].c_str());
107 std::string pname = groups[j] +
":FK Random";
108 for (
int i = 0; i < N; ++i)
111 state.setToRandomPositions(jmg);
121 ROS_ERROR(
"Unable to initialize robot model.");
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
static const std::string ROBOT_DESCRIPTION
ROSCPP_DECL void shutdown()
const robot_model::RobotModelPtr & getModel() const
Get the constructed planning_models::RobotModel.
int main(int argc, char **argv)