21 #include <Eigen/Geometry> 27 #include <visualization_msgs/Marker.h> 28 #include <visualization_msgs/MarkerArray.h> 31 #include "ISM/recognizer/VotingSpace.hpp" 33 #include <ISM/common_type/Point.hpp> 34 #include <ISM/common_type/Quaternion.hpp> 35 #include <ISM/common_type/Pose.hpp> 36 #include <ISM/common_type/Track.hpp> 37 #include <ISM/common_type/VoteSpecifier.hpp> 39 #include <boost/random/uniform_real.hpp> 40 #include <boost/random/mersenne_twister.hpp> 41 #include <boost/random/variate_generator.hpp> 55 bool operator()(
const Eigen::Vector3i& a,
const Eigen::Vector3i& b)
const {
56 if(a.x() != b.x() || a.y() != b.y() || a.z() != b.z())
67 static geometry_msgs::Point pointToPointMsg(ISM::PointPtr point);
68 static geometry_msgs::Quaternion quatToQuaternionMsg(ISM::QuaternionPtr quat);
69 static std::vector<ISM::PosePtr> posesFromTrack(ISM::TrackPtr track);
70 static geometry_msgs::Point EVector3DToPointMsg(ISM::PointPtr point, Eigen::Vector3d v3d);
75 static ColorRGBA createColorRGBA(
float red,
float green,
float blue,
float alpha);
76 static ColorRGBA createColorRGBA(std::vector<float> rgba);
81 static ColorRGBA hsvToRGBA(
double hue,
double saturation,
double value);
86 static ColorRGBA confidenceToColor(
double confidence);
88 static ColorRGBA getColorOfObject(
const ISM::Object&
object);
89 static ColorRGBA getColorOfObject(
const ISM::ObjectPtr object_ptr);
94 static Marker createMarkerWithoutTypeAndPose(std::string baseFrame, std::string markerNamespace,
int id,
float xScale,
float yScale,
float zScale, ColorRGBA color,
double markerLifetime);
96 static Marker createSphereMarker(ISM::PointPtr point, std::string baseFrame, std::string markerNamespace,
int id,
float radius, ColorRGBA color,
double markerLifetime);
98 static Marker createConeMarker(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace,
int id,
float radius, ColorRGBA color,
double markerLifetime);
100 static Marker createCylinderMarker(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace,
int id,
float radius,
float height, ColorRGBA color,
double markerLifetime);
102 static Marker createArrowMarkerToPoint(ISM::PointPtr fromPoint, ISM::PointPtr to, std::string baseFrame, std::string markerNamespace,
int id,
float xScale,
float yScale,
float zScale, ColorRGBA color,
double markerLifetime);
104 static Marker createArrowMarkerToPoint(ISM::PointPtr fromPoint, ISM::PointPtr to, std::string baseFrame, std::string markerNamespace,
int id,
float xScale,
float yScale,
float zScale, ColorRGBA color,
double markerLifetime,
double minLength);
106 static Marker createMeshMarker(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace,
int id, ColorRGBA color,
double markerLifetime, std::string resourcePath);
108 static MarkerArray createTrackMarkers(std::vector<ISM::PosePtr> trackPoses, std::string baseFrame, std::string markerNamespace,
float lineWidth, ColorRGBA color,
double markerLifetime);
111 (ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace,
int id,
114 static Marker createLineMarkerFormPair(std::vector<std::pair<ISM::PointPtr, ISM::PointPtr>> pointPair, std::string baseFrame, std::string markerNamespace,
float arrowScale, ColorRGBA color,
double markerLifetime);
116 static std::vector<geometry_msgs::Point> calculateAxesPoints(ISM::PointPtr point, ISM::QuaternionPtr quat,
float scale);
118 static MarkerArray createCoordinateArrow(std::vector<std::pair<ISM::PointPtr, std::vector<ISM::PosePtr> > > poses_vec, std::string baseFrame, std::string markerNamespace,
float arrowScale,
float axisScale, ColorRGBA color,
double markerLifetime);
120 static MarkerArray createCoordinateMarkerWithAngle(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace,
int id,
float length,
float openAngle,
double markerLifetime);
122 static MarkerArray createRingMarker(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace,
float scale, ColorRGBA
x, ColorRGBA
y, ColorRGBA
z, ColorRGBA a, ColorRGBA b, ColorRGBA g,
double markerLifetime);
124 static Marker createLineArrow(ISM::PointPtr fromPoint, std::vector<ISM::PosePtr> toPoses, std::string baseFrame, std::string markerNamespace,
int &
id,
float arrowScale, ColorRGBA color,
double markerLifetime);
126 static MarkerArray createCubeArrow(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace,
int &
id,
float scale, ColorRGBA cubeColor, ColorRGBA arrowColor,
double markerLifetime);
128 static Marker createCylinderLine(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace,
float scale,
float length, ColorRGBA color,
double markerLifetime);
130 static MarkerArray createPositionVector(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace, ColorRGBA color, UniformDistributionGenerator* udg,
int sampels,
int axis,
int id,
float length,
float openAngle,
float sphereRadius,
double markerLifetime);
132 static geometry_msgs::Point createPoint(
double x,
double y,
double z);
135 ISM::ObjectPtr o, std::string baseFrame, std::string ns, int32_t
id,
double bin_size,
137 static MarkerArray createCoordinateMarker(ISM::PosePtr pose, std::string baseFrame, std::string markerNamespace,
int id,
float length,
float radius,
double markerLifetime);
139 static Marker pointToCuboid(std::string ns, int32_t
id, std::string frame,
140 double x,
double y,
double z,
double xwitdh,
double ywidth,
double zwidth,
143 static geometry_msgs::Point genCuboidPoint(
int xp,
int yp,
int zp,
double x,
double y,
double z,
double xwidth,
double ywidth,
double zwidth);
145 static Marker pointToCube(std::string ns,
int id, std::string frame,
148 static Marker getBinMarker(Eigen::Vector3i bin,
double bin_size,
151 static Marker getBinMarker(
int x,
int y,
int z,
double bin_size,
154 static MarkerArray getBinFromPoint (
const ISM::PointPtr point,
157 static std::map<Eigen::Vector3i, bool, cmpVector3i >
binDrawn;
159 static Marker createLine(ISM::PointPtr fromPoint, ISM::PointPtr toPoint,
float width,
int id, std::string baseFrame, std::string markerNamespace,
std_msgs::ColorRGBA color,
double markerLifetime);
static std::map< Eigen::Vector3i, bool, cmpVector3i > binDrawn
visualization_msgs::Marker Marker
TFSIMD_FORCE_INLINE const tfScalar & y() const
static ColorRGBA createColorRGBA(float red, float green, float blue, float alpha)
std_msgs::ColorRGBA ColorRGBA
TFSIMD_FORCE_INLINE const tfScalar & x() const
visualization_msgs::MarkerArray MarkerArray
TFSIMD_FORCE_INLINE const tfScalar & z() const
bool operator()(const Eigen::Vector3i &a, const Eigen::Vector3i &b) const
boost::variate_generator< boost::mt19937, boost::uniform_real<> > UniformDistributionGenerator
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)