/** * CallBack creating markers based on received toaster_msgs and adding then to robot_list * Robots can be representated by a single unarticulated mesh or by mutiple meshs for an articulated model * @param msg reference to receive toaster_msgs::RobotList * @return void */ void chatterCallbackRobotList(const toaster_msgs::RobotList::ConstPtr& msg) { robot_list.markers.clear(); for (int i = 0; i < msg->robotList.size(); i++) { //non articulated robot visualization_msgs::Marker m = defineRobot(msg->robotList[i].meAgent.meEntity.positionX, msg->robotList[i].meAgent.meEntity.positionY, msg->robotList[i].meAgent.meEntity.positionZ, msg->robotList[i].meAgent.meEntity.orientationRoll, msg->robotList[i].meAgent.meEntity.orientationPitch, msg->robotList[i].meAgent.meEntity.orientationYaw, 1.0, msg->robotList[i].meAgent.meEntity.name); visualization_msgs::Marker mn = defineName(m); mn = setPosition(mn, mn.pose.position.x, mn.pose.position.y, 3); mn = setSize(mn, 0, 0, 0.5); mn = setColor(mn, 1.0, 1.0, 1.0); robot_list.markers.push_back(mn); robot_list.markers.push_back(m); ROS_DEBUG("robot %d", m.id); } }
Robot::Robot(int t){ setType(t); action = new Action(); defineRobot(); }