22 #include <ISM/recognizer/VotingSpace.hpp> 23 #include <ISM/utility/Util.hpp> 24 #include <ISM/utility/GeometryHelper.hpp> 43 std::string markerNamespace = this->
prefix +
"Object_Mesh_";
46 for(
const ISM::ObjectPtr&
object : objects)
49 tempPath =
object->ressourcePath.string();
50 if( !tempPath.empty() )
58 std::map<ISM::ObjectPtr, double>::const_iterator it = objects_to_hue_map.find(
object);
59 if (it != objects_to_hue_map.end())
62 tempObjectMarker.color.a = 0.5;
66 retMarkers.markers.push_back(tempObjectMarker);
71 id, 0.05, 0.002, this->markerLifetime);
74 retMarkers.markers.insert(retMarkers.markers.end(), tempMarkers.markers.begin(), tempMarkers.markers.end());
75 retMarkers.markers.insert(retMarkers.markers.end(), tempMarkers.markers.begin(), tempMarkers.markers.end());
76 id += tempMarkers.markers.size();
79 visualization_msgs::Marker axisMarker =
VIZ::VizHelperRVIZ::createMarkerWithoutTypeAndPose(
baseFrame, markerNamespace + object->type + object->observedId +
"_xAXIS",
id++, 0.1, 0.01, 0.01,
VIZ::VizHelperRVIZ::createColorRGBA(1, 0, 0, 1),
markerLifetime);
80 axisMarker.type = visualization_msgs::Marker::ARROW;
81 Eigen::Quaterniond transformed_X_Axis = Eigen::AngleAxisd(0.0, Eigen::Vector3d::UnitX()) * ISM::GeometryHelper::quatToEigenQuat(object->pose->quat);
84 axisMarker.action = visualization_msgs::Marker::ADD;
85 retMarkers.markers.push_back(axisMarker);
void publishCollectedMarkers()
static ColorRGBA hsvToRGBA(double hue, double saturation, double value)
static MarkerArray createCoordinateMarker(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace, int id, float length, float radius, double markerLifetime)
static ColorRGBA getColorOfObject(const ISM::Object &object)
void drawObjectModels(const std::vector< ISM::ObjectPtr > &objects, const std::map< ISM::ObjectPtr, double > &objects_to_hue_map=std::map< ISM::ObjectPtr, double >())
visualization_msgs::Marker Marker
static geometry_msgs::Point pointToPointMsg(ISM::PointPtr point)
static geometry_msgs::Quaternion quatToQuaternionMsg(ISM::QuaternionPtr quat)
static ColorRGBA createColorRGBA(float red, float green, float blue, float alpha)
visualization_msgs::MarkerArray MarkerArray
void addMarker(visualization_msgs::Marker marker)
static Marker createMeshMarker(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace, int id, ColorRGBA color, double markerLifetime, std::string resourcePath)
static Marker createMarkerWithoutTypeAndPose(std::string baseFrame, std::string markerNamespace, int id, float xScale, float yScale, float zScale, ColorRGBA color, double markerLifetime)
visualization_msgs::MarkerArray getMarkersFromObjects(const std::vector< ISM::ObjectPtr > objects, const std::map< ISM::ObjectPtr, double > &objects_to_hue_map)