fake_kobuki_ros.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013, Yujin Robot.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
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 Yujin Robot nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef _FAKE_KOBUKI_NODE_H_
31 #define _FAKE_KOBUKI_NODE_H_
32 
33 #include <ros/ros.h>
34 #include <geometry_msgs/Twist.h>
36 #include <sensor_msgs/Imu.h>
37 #include <kobuki_msgs/ButtonEvent.h>
38 #include <kobuki_msgs/BumperEvent.h>
39 #include <kobuki_msgs/CliffEvent.h>
40 #include <kobuki_msgs/DigitalOutput.h>
41 #include <kobuki_msgs/DigitalInputEvent.h>
42 #include <kobuki_msgs/ExternalPower.h>
43 #include <kobuki_msgs/DockInfraRed.h>
44 #include <kobuki_msgs/Led.h>
45 #include <kobuki_msgs/MotorPower.h>
46 #include <kobuki_msgs/PowerSystemEvent.h>
47 #include <kobuki_msgs/RobotStateEvent.h>
48 #include <kobuki_msgs/SensorState.h>
49 #include <kobuki_msgs/Sound.h>
50 #include <kobuki_msgs/VersionInfo.h>
51 #include <kobuki_msgs/WheelDropEvent.h>
52 
53 #include "fake_kobuki.h"
54 
55 namespace kobuki
56 {
58  {
59  public:
60  FakeKobukiRos(std::string& node_name);
62 
63  bool init(ros::NodeHandle& nh);
64  bool update();
65 
66  private:
67  // private functions
71 
72  // subscriber callbacks
73  void subscribeVelocityCommand(const geometry_msgs::TwistConstPtr msg);
74  void subscribeMotorPowerCommand(const kobuki_msgs::MotorPowerConstPtr msg);
75 
76  void updateJoint(unsigned int index,double& w,ros::Duration step_time);
77  void updateOdometry(double w_left,double w_right, ros::Duration step_time);
78  void updateTF(geometry_msgs::TransformStamped& odom_tf);
79 
81  // Variables
83  std::string name;
86 
87  // version_info, joint_states
88  std::map<std::string,ros::Publisher> publisher;
89  // button, bumper, cliff, wheel_drop, power_system, digital_input, robot_state
90  std::map<std::string,ros::Publisher> event_publisher;
91  // sensor_core, dock_ir, imu_data
92  std::map<std::string,ros::Publisher> sensor_publisher;
93  // no debug publisher
95 
96  // command subscribers
97  std::map<std::string,ros::Subscriber> subscriber;
98 
100  };
101 }
102 #endif
std::map< std::string, ros::Subscriber > subscriber
void advertiseTopics(ros::NodeHandle &nh)
void updateTF(geometry_msgs::TransformStamped &odom_tf)
std::map< std::string, ros::Publisher > publisher
void updateJoint(unsigned int index, double &w, ros::Duration step_time)
tf::TransformBroadcaster tf_broadcaster
std::map< std::string, ros::Publisher > event_publisher
std::map< std::string, ros::Publisher > sensor_publisher
void subscribeTopics(ros::NodeHandle &nh)
void subscribeMotorPowerCommand(const kobuki_msgs::MotorPowerConstPtr msg)
void updateOdometry(double w_left, double w_right, ros::Duration step_time)
bool init(ros::NodeHandle &nh)
FakeKobukiRos(std::string &node_name)
TFSIMD_FORCE_INLINE const tfScalar & w() const
void subscribeVelocityCommand(const geometry_msgs::TwistConstPtr msg)


kobuki_softnode
Author(s): Jihoon Lee
autogenerated on Mon Jun 10 2019 13:52:14