36 #ifndef JSK_RECOGNITION_UTILS_GEO_SEGMENT_H_ 37 #define JSK_RECOGNITION_UTILS_GEO_SEGMENT_H_ 41 #include "visualization_msgs/Marker.h" 62 Segment(
const Eigen::Vector3f& from,
const Eigen::Vector3f to);
68 virtual void getEnd(Eigen::Vector3f& output)
const;
69 virtual Eigen::Vector3f
getEnd()
const;
71 virtual void foot(
const Eigen::Vector3f&
point, Eigen::Vector3f& output)
const;
74 virtual double distance(
const Eigen::Vector3f&
point, Eigen::Vector3f& foot_point)
const;
88 Eigen::Vector3f& foot_point,
89 double &distance_to_goal)
const;
101 virtual double length()
const;
107 void toMarker(visualization_msgs::Marker& marker)
const;
113 virtual bool isCross (
const Line &ln,
double distance_threshold = 1e-5)
const;
114 virtual bool isCross (
const Segment &ln,
double distance_threshold = 1e-5)
const;
virtual double distanceWithInfo(const Eigen::Vector3f &from, Eigen::Vector3f &foot_point, double &distance_to_goal) const
compute a distance to a point
virtual double distance(const Eigen::Vector3f &point) const
virtual bool intersect(Plane &plane, Eigen::Vector3f &point) const
Segment(const Eigen::Vector3f &from, const Eigen::Vector3f to)
Construct a line from a start point and a goal point.
boost::shared_ptr< Segment > Ptr
virtual void point(double alpha, Eigen::Vector3f &ouptut)
Compute a point on normal from alpha parameter.
Class to represent 3-D straight line which has finite length.
void toMarker(visualization_msgs::Marker &marker) const
make marker message to display the finite line
virtual Eigen::Vector3f getEnd() const
virtual void foot(const Eigen::Vector3f &point, Eigen::Vector3f &output) const
compute a point which gives perpendicular projection.
virtual void midpoint(Eigen::Vector3f &midpoint) const
virtual double dividingRatio(const Eigen::Vector3f &point) const
virtual bool isCross(const Line &ln, double distance_threshold=1e-5) const
is crossing with another line
friend std::ostream & operator<<(std::ostream &os, const Segment &seg)
virtual Segment::Ptr flipSegment() const
return flipped line (line of opposite direction)
virtual double length() const
return length of the line
Class to represent 3-D straight line.