Go to the documentation of this file.
38 #include <sensor_msgs/PointCloud2.h>
39 #include <sensor_msgs/LaserScan.h>
58 #define LASER_INFO NODELET_INFO
59 #define LASER_WARN NODELET_WARN
61 #define LASER_INFO ROS_INFO
62 #define LASER_WARN ROS_WARN
174 std::string cloud_filter_xml;
192 LASER_INFO(
"Scan to cloud filter initialized.");
199 LASER_WARN(
"Use of '~scan_topic' parameter in scan_to_cloud_filter_chain has been deprecated.");
202 LASER_WARN(
"Use of '~cloud_topic' parameter in scan_to_cloud_filter_chain has been deprecated.");
205 LASER_WARN(
"Use of '~laser_max_range' parameter in scan_to_cloud_filter_chain has been deprecated.");
208 LASER_WARN(
"Use of '~filter_window' parameter in scan_to_cloud_filter_chain has been deprecated.");
211 LASER_WARN(
"Use of default '~target_frame' parameter in scan_to_cloud_filter_chain has been deprecated. Default currently set to 'base_link' please set explicitly as appropriate.");
214 LASER_WARN(
"Use of '~cloud_filters/filter_chain' parameter in scan_to_cloud_filter_chain has been deprecated. Replace with '~cloud_filter_chain'");
217 LASER_WARN(
"Use of '~scan_filters/filter_chain' parameter in scan_to_cloud_filter_chain has been deprecated. Replace with '~scan_filter_chain'");
220 LASER_WARN(
"Use of '~cloud_filters/cloud_filter_chain' parameter in scan_to_cloud_filter_chain is incorrect. Please Replace with '~cloud_filter_chain'");
223 LASER_WARN(
"Use of '~scan_filters/scan_filter_chain' parameter in scan_to_scan_filter_chain is incorrect. Please Replace with '~scan_filter_chain'");
238 sensor_msgs::LaserScan filtered_scan;
242 sensor_msgs::PointCloud2 scan_cloud;
248 for (
unsigned int i = 0; i < filtered_scan.ranges.size(); i++)
250 double angle = filtered_scan.angle_min + i * filtered_scan.angle_increment;
251 filtered_scan.ranges[i] = filtered_scan.ranges[i] + 0.03 * exp(-fabs(sin(
angle)));
265 LASER_WARN(
"High fidelity enabled, but TF returned a transform exception to frame %s: %s",
target_frame_.c_str (), ex.what ());
275 sensor_msgs::PointCloud2 filtered_cloud;
287 std::unique_ptr<ScanToCloudFilterChain> chain_;
299 ros::init (argc, argv,
"scan_to_cloud_filter_chain");
std::string getName() const
ros::NodeHandle & getNodeHandle() const
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
bool incident_angle_correction_
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
bool using_cloud_topic_deprecated_
void setTolerance(const ros::Duration &tolerance)
bool using_scan_filters_wrong_deprecated_
tf::TransformListener tf_
std::string target_frame_
bool using_cloud_filters_deprecated_
ros::Publisher cloud_pub_
void transformLaserScanToPointCloud(const std::string &target_frame, const sensor_msgs::LaserScan &scan_in, sensor_msgs::PointCloud &cloud_out, tf::Transformer &tf, double range_cutoff, int channel_options=channel_option::Default)
message_filters::Subscriber< sensor_msgs::LaserScan > sub_
bool using_filter_window_deprecated_
filters::FilterChain< sensor_msgs::PointCloud2 > cloud_filter_chain_
bool using_laser_max_range_deprecated_
ros::NodeHandle & getPrivateNodeHandle() const
void publish(const boost::shared_ptr< M > &message) const
ros::NodeHandle private_nh
Publisher advertise(AdvertiseOptions &ops)
bool configure(std::string param_name, ros::NodeHandle node=ros::NodeHandle())
bool using_scan_filters_deprecated_
bool using_scan_topic_deprecated_
bool update(const T &data_in, T &data_out)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
ros::Timer deprecation_timer_
tf::MessageFilter< sensor_msgs::LaserScan > filter_
bool using_default_target_frame_deprecated_
laser_geometry::LaserProjection projector_
bool hasParam(const std::string &key) const
int main(int argc, char **argv)
unsigned int channel_options_
ScanToCloudFilterChain(ros::NodeHandle &nh_, ros::NodeHandle &pnh, const std::string &name)
void scanCallback(const sensor_msgs::LaserScan::ConstPtr &scan_msg)
void setTargetFrame(const std::string &target_frame)
const std::string & getName() const
T param(const std::string ¶m_name, const T &default_val) const
Timer createTimer(Duration period, const TimerCallback &callback, bool oneshot=false, bool autostart=true) const
filters::FilterChain< sensor_msgs::LaserScan > scan_filter_chain_
bool using_cloud_filters_wrong_deprecated_
void deprecation_warn(const ros::TimerEvent &e)
laser_filters
Author(s): Tully Foote
autogenerated on Mon Apr 3 2023 02:51:57