rawlog_play_node.h
Go to the documentation of this file.
1 /***********************************************************************************
2  * Revised BSD License *
3  * Copyright (c) 2014, Markus Bader <markus.bader@tuwien.ac.at> *
4  * All rights reserved. *
5  * *
6  * Redistribution and use in source and binary forms, with or without *
7  * modification, are permitted provided that the following conditions are met: *
8  * * Redistributions of source code must retain the above copyright *
9  * notice, this list of conditions and the following disclaimer. *
10  * * Redistributions in binary form must reproduce the above copyright *
11  * notice, this list of conditions and the following disclaimer in the *
12  * documentation and/or other materials provided with the distribution. *
13  * * Neither the name of the Vienna University of Technology nor the *
14  * names of its contributors may be used to endorse or promote products *
15  * derived from this software without specific prior written permission. *
16  * *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  *AND *
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20  **
21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
22  * DISCLAIMED. IN NO EVENT SHALL Markus Bader BE LIABLE FOR ANY *
23  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  **
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
27  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29  **
30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  ** *
32  ***********************************************************************************/
33 
34 #ifndef MRPT_RAWLOG_PLAY_NODE_H
35 #define MRPT_RAWLOG_PLAY_NODE_H
36 
37 #include <dynamic_reconfigure/server.h>
38 #include <mrpt/obs/CObservation.h>
39 #include <mrpt_msgs/ObservationRangeBeacon.h>
40 #include <mrpt_msgs/ObservationRangeBearing.h>
41 #include <nav_msgs/Odometry.h>
42 #include <sensor_msgs/LaserScan.h>
43 
44 #include "geometry_msgs/TransformStamped.h"
45 #include "mrpt_rawlog/RawLogRecordConfig.h"
47 #include "ros/ros.h"
50 
52 class RawlogPlayNode : public RawlogPlay
53 {
54  public:
55  struct ParametersNode : public Parameters
56  {
57  static const int MOTION_MODEL_GAUSSIAN = 0;
58  static const int MOTION_MODEL_THRUN = 1;
61  void callbackParameters(
62  mrpt_rawlog::RawLogRecordConfig& config, uint32_t level);
63  dynamic_reconfigure::Server<mrpt_rawlog::RawLogRecordConfig>
65  dynamic_reconfigure::Server<
66  mrpt_rawlog::RawLogRecordConfig>::CallbackType reconfigureFnc_;
67  void update(const unsigned long& loop_count);
68  double rate;
69  std::string base_frame;
70  std::string odom_frame;
72  };
73 
76  void init();
77  void loop();
78 
79  private: // functions
81  bool nextEntry();
82  void publishSingleObservation(const mrpt::obs::CObservation::Ptr& o);
83 
84  private: // variables
86  unsigned long loop_count_;
87  sensor_msgs::LaserScan msg_laser_;
88  mrpt_msgs::ObservationRangeBeacon msg_beacon_;
89  mrpt_msgs::ObservationRangeBearing msg_landmark_;
90  nav_msgs::Odometry msg_odom_;
94  std::string odom_frame_;
95  std::string base_frame_;
97 };
98 
99 #endif // MRPT_RAWLOG_PLAY_NODE_H
RawlogPlayNode
ROS Node.
Definition: rawlog_play_node.h:52
RawlogPlayNode::ParametersNode::callbackParameters
void callbackParameters(mrpt_rawlog::RawLogRecordConfig &config, uint32_t level)
Definition: rawlog_play_node_parameters.cpp:63
RawlogPlayNode::pub_landmark_
ros::Publisher pub_landmark_
Definition: rawlog_play_node.h:124
ros::Publisher
RawlogPlayNode::init
void init()
Definition: rawlog_play_node.cpp:74
RawlogPlayNode::pub_laser_
ros::Publisher pub_laser_
Definition: rawlog_play_node.h:122
RawlogPlayNode::ParametersNode::node
ros::NodeHandle node
Definition: rawlog_play_node.h:122
RawlogPlayNode::ParametersNode::reconfigureFnc_
dynamic_reconfigure::Server< mrpt_rawlog::RawLogRecordConfig >::CallbackType reconfigureFnc_
Definition: rawlog_play_node.h:128
ros.h
RawlogPlayNode::publishSingleObservation
void publishSingleObservation(const mrpt::obs::CObservation::Ptr &o)
Definition: rawlog_play_node.cpp:92
RawlogPlayNode::msg_landmark_
mrpt_msgs::ObservationRangeBearing msg_landmark_
Definition: rawlog_play_node.h:120
RawlogPlayNode::n_
ros::NodeHandle n_
Definition: rawlog_play_node.h:116
RawlogPlayNode::ParametersNode::odom_frame
std::string odom_frame
Definition: rawlog_play_node.h:132
transform_broadcaster.h
RawlogPlayNode::base_frame_
std::string base_frame_
Definition: rawlog_play_node.h:126
RawlogPlayNode::loop
void loop()
Definition: rawlog_play_node.cpp:224
RawlogPlayNode::msg_laser_
sensor_msgs::LaserScan msg_laser_
Definition: rawlog_play_node.h:118
RawlogPlayNode::ParametersNode::rate
double rate
Definition: rawlog_play_node.h:130
RawlogPlayNode::RawlogPlayNode
RawlogPlayNode(ros::NodeHandle &n)
Definition: rawlog_play_node.cpp:64
RawlogPlayNode::ParametersNode::reconfigureServer_
dynamic_reconfigure::Server< mrpt_rawlog::RawLogRecordConfig > reconfigureServer_
Definition: rawlog_play_node.h:126
RawlogPlayNode::ParametersNode
Definition: rawlog_play_node.h:86
RawlogPlayNode::param
ParametersNode * param()
Definition: rawlog_play_node.cpp:69
RawlogPlayNode::ParametersNode::ParametersNode
ParametersNode()
Definition: rawlog_play_node_parameters.cpp:37
RawlogPlayNode::msg_odom_
nav_msgs::Odometry msg_odom_
Definition: rawlog_play_node.h:121
RawlogPlayNode::ParametersNode::MOTION_MODEL_GAUSSIAN
static const int MOTION_MODEL_GAUSSIAN
Definition: rawlog_play_node.h:119
RawlogPlayNode::msg_beacon_
mrpt_msgs::ObservationRangeBeacon msg_beacon_
Definition: rawlog_play_node.h:119
RawlogPlayNode::~RawlogPlayNode
~RawlogPlayNode()
Definition: rawlog_play_node.cpp:63
RawlogPlayNode::ParametersNode::update
void update(const unsigned long &loop_count)
Definition: rawlog_play_node_parameters.cpp:56
RawlogPlayNode::pub_beacon_
ros::Publisher pub_beacon_
Definition: rawlog_play_node.h:123
tf2_ros::TransformBroadcaster
tf2_geometry_msgs.h
RawlogPlayNode::loop_count_
unsigned long loop_count_
Definition: rawlog_play_node.h:117
RawlogPlayNode::ParametersNode::MOTION_MODEL_THRUN
static const int MOTION_MODEL_THRUN
Definition: rawlog_play_node.h:120
RawlogPlay::Parameters
Definition: rawlog_play.h:78
RawlogPlayNode::ParametersNode::parameter_update_skip
int parameter_update_skip
Definition: rawlog_play_node.h:133
RawlogPlayNode::odom_frame_
std::string odom_frame_
Definition: rawlog_play_node.h:125
RawlogPlay
Definition: rawlog_play.h:44
RawlogPlayNode::tf_broadcaster_
tf2_ros::TransformBroadcaster tf_broadcaster_
Definition: rawlog_play_node.h:127
RawlogPlayNode::nextEntry
bool nextEntry()
Definition: rawlog_play_node.cpp:161
rawlog_play.h
ros::NodeHandle
RawlogPlayNode::ParametersNode::base_frame
std::string base_frame
Definition: rawlog_play_node.h:131


mrpt_rawlog
Author(s):
autogenerated on Tue Sep 17 2024 02:10:22