35 const stdr_msgs::RfidSensorMsg& msg,
36 const std::string& name,
39 Sensor(map, name, n, msg.pose, msg.frame_id, msg.frequency)
47 "stdr_server/rfid_list",
70 stdr_msgs::RfidSensorMeasurementMsg measuredTagsMsg;
77 float min_angle = sensor_th -
_description.angleSpan / 2.0;
78 float max_angle = sensor_th +
_description.angleSpan / 2.0;
81 for(
unsigned int i = 0 ; i <
rfid_tags_.rfid_tags.size() ; i++)
87 pow(sensor_x -
rfid_tags_.rfid_tags[i].pose.x, 2) +
88 pow(sensor_y -
rfid_tags_.rfid_tags[i].pose.y, 2)
96 float ang = atan2(
rfid_tags_.rfid_tags[i].pose.y - sensor_y,
104 measuredTagsMsg.rfid_tags_ids.push_back(
rfid_tags_.rfid_tags[i].tag_id);
105 measuredTagsMsg.rfid_tags_msgs.push_back(
rfid_tags_.rfid_tags[i].message);
106 measuredTagsMsg.rfid_tags_dbs.push_back(1.0);
const std::string & _namespace
< The base for the sensor frame_id
void publish(const boost::shared_ptr< M > &message) const
stdr_msgs::RfidSensorMsg _description
< Sonar rfid reader description
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
The main namespace for STDR Robot.
static double getYaw(const Quaternion &bt_q)
A class that provides sensor abstraction.
virtual void updateSensorCallback()
Updates the sensor measurements.
ros::Subscriber rfids_subscriber_
The currently existent RFID tags.
TFSIMD_FORCE_INLINE const tfScalar & x() const
~RfidReader(void)
Default destructor.
tf::StampedTransform _sensorTransform
True if sensor got the _sensorTransform.
TFSIMD_FORCE_INLINE const tfScalar & y() const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void receiveRfids(const stdr_msgs::RfidTagVector &msg)
Receives the existent rfid tags.
static bool angCheck(float target_, float min_, float max_)
Checks if an angle is between two others. Supposes that min < max.
stdr_msgs::RfidTagVector rfid_tags_
RfidReader(const nav_msgs::OccupancyGrid &map, const stdr_msgs::RfidSensorMsg &msg, const std::string &name, ros::NodeHandle &n)
Default constructor.
ros::Publisher _publisher
ROS tf listener.