8 #ifndef VIRTUAL_SENSOR_NODE_HPP_ 9 #define VIRTUAL_SENSOR_NODE_HPP_ 13 #include <sensor_msgs/LaserScan.h> 17 #include <yocs_msgs/Wall.h> 18 #include <yocs_msgs/WallList.h> 19 #include <yocs_msgs/Column.h> 20 #include <yocs_msgs/ColumnList.h> 64 if ((intersects ==
false) || (distance > max_dist))
83 p1_.setX(- width_/2.0);
84 p1_.setY(- length_/2.0);
86 p2_.setX(+ width_/2.0);
87 p2_.setY(+ length_/2.0);
97 double width() {
return width_; }
102 mtk::raySegmentIntersection(0.0, 0.0, rx, ry, p1_.x(), p1_.y(), p2_.x(), p2_.y(), ix, iy,
distance);
103 if ((intersects ==
false) || (distance > max_dist))
122 void columnPosesCB(
const yocs_msgs::ColumnList::ConstPtr& msg);
123 void wallPosesCB(
const yocs_msgs::WallList::ConstPtr& msg);
Obstacle(const std::string &name, const tf::Transform &tf, double height)
Column(const std::string &name, const tf::Transform &tf, double radius, double height)
ros::Subscriber wall_poses_sub_
bool intersects(double rx, double ry, double max_dist, double &distance)
ros::Subscriber column_poses_sub_
bool raySegmentIntersection(double r1x, double r1y, double r2x, double r2y, double s1x, double s1y, double s2x, double s2y, double &ix, double &iy, double &distance)
double distance2D(double ax, double ay, double bx, double by)
bool rayCircleIntersection(double rx, double ry, double cx, double cy, double radius, double &ix, double &iy, double &distance)
TFSIMD_FORCE_INLINE const tfScalar & x() const
ros::Subscriber table_poses_sub_
TFSIMD_FORCE_INLINE const tfScalar & z() const
std::vector< yocs_msgs::Wall > walls_
void columnPosesCB(const yocs_msgs::ColumnList::ConstPtr &msg)
TFSIMD_FORCE_INLINE const tfScalar & y() const
std::string sensor_frame_id_
double pointSegmentDistance(double px, double py, double s1x, double s1y, double s2x, double s2y)
tf::TransformListener tf_listener_
sensor_msgs::LaserScan scan_
Wall(const std::string &name, const tf::Transform &tf, double length, double width, double height)
ros::Publisher virtual_obs_pub_
bool add(boost::shared_ptr< Obstacle > &new_obs, std::vector< boost::shared_ptr< Obstacle > > &obstacles)
virtual bool intersects(double rx, double ry, double max_dist, double &distance)=0
void wallPosesCB(const yocs_msgs::WallList::ConstPtr &msg)
std::vector< yocs_msgs::Column > columns_
bool intersects(double rx, double ry, double max_dist, double &distance)
std::string global_frame_id_