40 #ifndef KOBUKI_ROS_HPP_ 41 #define KOBUKI_ROS_HPP_ 48 #include <boost/shared_ptr.hpp> 52 #include <std_msgs/Empty.h> 53 #include <std_msgs/String.h> 54 #include <std_msgs/Int16MultiArray.h> 55 #include <sensor_msgs/JointState.h> 56 #include <sensor_msgs/Imu.h> 58 #include <kobuki_msgs/ButtonEvent.h> 59 #include <kobuki_msgs/BumperEvent.h> 60 #include <kobuki_msgs/CliffEvent.h> 61 #include <kobuki_msgs/ControllerInfo.h> 62 #include <kobuki_msgs/DigitalOutput.h> 63 #include <kobuki_msgs/DigitalInputEvent.h> 64 #include <kobuki_msgs/ExternalPower.h> 65 #include <kobuki_msgs/DockInfraRed.h> 66 #include <kobuki_msgs/Led.h> 67 #include <kobuki_msgs/MotorPower.h> 68 #include <kobuki_msgs/PowerSystemEvent.h> 69 #include <kobuki_msgs/RobotStateEvent.h> 70 #include <kobuki_msgs/SensorState.h> 71 #include <kobuki_msgs/Sound.h> 72 #include <kobuki_msgs/VersionInfo.h> 73 #include <kobuki_msgs/WheelDropEvent.h> 92 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
178 void rosNamed(
const std::vector<std::string> &msgs) {
179 if (msgs.size()==0)
return;
181 if (msgs.size()==2) {
183 else if (msgs[0] ==
"info" ) {
ROS_INFO_STREAM (
"Kobuki : " << msgs[1]); }
184 else if (msgs[0] ==
"warn" ) {
ROS_WARN_STREAM (
"Kobuki : " << msgs[1]); }
188 if (msgs.size()==3) {
void publishPowerEvent(const PowerEvent &event)
BatteryTask battery_diagnostics
ecl::Slot< const RobotEvent & > slot_robot_event
WheelDropTask wheel_diagnostics
ros::Publisher wheel_event_publisher
void rosWarn(const std::string &msg)
ecl::Slot< const std::string & > slot_info
void subscribeMotorPower(const kobuki_msgs::MotorPowerConstPtr msg)
#define ROS_DEBUG_STREAM_NAMED(name, args)
void rosInfo(const std::string &msg)
#define ROS_ERROR_STREAM_NAMED(name, args)
void subscribeDigitalOutputCommand(const kobuki_msgs::DigitalOutputConstPtr)
void publishWheelEvent(const WheelEvent &event)
ecl::Slot< const std::vector< std::string > & > slot_named
ros::Publisher robot_event_publisher
KobukiRos(std::string &node_name)
Default constructor.
ecl::Slot< const ButtonEvent & > slot_button_event
ros::Publisher raw_imu_data_publisher
ros::Publisher version_info_publisher
void rosError(const std::string &msg)
void publishControllerInfo()
#define ROS_INFO_STREAM_NAMED(name, args)
ecl::Slot< const BumperEvent & > slot_bumper_event
Diagnostics for the kobuki node.
ecl::Slot slot_stream_data
ecl::Slot< const PowerEvent & > slot_power_event
void publishButtonEvent(const ButtonEvent &event)
AnalogInputTask ainput_diagnostics
void publishInputEvent(const InputEvent &event)
sensor_msgs::JointState joint_states
WallSensorTask bumper_diagnostics
void subscribeControllerInfoCommand(const kobuki_msgs::ControllerInfoConstPtr msg)
MotorCurrentTask motor_diagnostics
ecl::Slot< Command::Buffer & > slot_raw_data_command
ros::Publisher bumper_event_publisher
void subscribeSoundCommand(const kobuki_msgs::SoundConstPtr)
Play a predefined sound (single sound or sound sequence)
ecl::Slot< PacketFinder::BufferType & > slot_raw_data_stream
void publishCliffEvent(const CliffEvent &event)
void subscribeLed1Command(const kobuki_msgs::LedConstPtr)
void publishRobotEvent(const RobotEvent &event)
ros::Publisher cliff_event_publisher
ros::Publisher raw_data_stream_publisher
ros::Publisher controller_info_publisher
Odometry for the kobuki node.
ecl::Slot< const std::string & > slot_warn
#define ROS_FATAL_STREAM(args)
ros::Publisher input_event_publisher
#define ROS_FATAL_STREAM_NAMED(name, args)
ros::Publisher imu_data_publisher
ros::Subscriber digital_output_command_subscriber
void publishRawDataStream(PacketFinder::BufferType &buffer)
Prints the raw data stream to a publisher.
GyroSensorTask gyro_diagnostics
WatchdogTask watchdog_diagnostics
ecl::Slot< const InputEvent & > slot_input_event
void subscribeExternalPowerCommand(const kobuki_msgs::ExternalPowerConstPtr)
ros::Publisher sensor_state_publisher
ecl::Slot< const VersionInfo & > slot_version_info
ros::Subscriber external_power_command_subscriber
ecl::Slot< const CliffEvent & > slot_cliff_event
void subscribeLed2Command(const kobuki_msgs::LedConstPtr)
ros::Subscriber controller_info_command_subscriber
ros::Subscriber velocity_command_subscriber
MotorStateTask state_diagnostics
void rosDebug(const std::string &msg)
ros::Publisher raw_data_command_publisher
#define ROS_WARN_STREAM(args)
#define ROS_DEBUG_STREAM(args)
ros::Subscriber led2_command_subscriber
void publishBumperEvent(const BumperEvent &event)
void publishRawDataCommand(Command::Buffer &buffer)
Prints the raw data stream to a publisher.
DigitalInputTask dinput_diagnostics
bool init(ros::NodeHandle &nh, ros::NodeHandle &nh_pub)
void publishVersionInfo(const VersionInfo &version_info)
Publish fw, hw, sw version information.
#define ROS_INFO_STREAM(args)
void publishSensorState()
ros::Subscriber led1_command_subscriber
ros::Publisher power_event_publisher
ros::Publisher joint_state_publisher
void rosNamed(const std::vector< std::string > &msgs)
CliffSensorTask cliff_diagnostics
ros::Subscriber motor_power_subscriber
void advertiseTopics(ros::NodeHandle &nh)
ros::Publisher dock_ir_publisher
ros::Publisher raw_control_command_publisher
ros::Subscriber reset_odometry_subscriber
#define ROS_ERROR_STREAM(args)
void subscribeResetOdometry(const std_msgs::EmptyConstPtr)
Reset the odometry variables.
void publishRawControlCommand(const std::vector< short > &velocity_commands)
void subscribeTopics(ros::NodeHandle &nh)
ecl::Slot< const std::string & > slot_error
ecl::Slot< const std::string & > slot_debug
ros::Publisher button_event_publisher
diagnostic_updater::Updater updater
ecl::Slot< const std::vector< short > & > slot_raw_control_command
void subscribeVelocityCommand(const geometry_msgs::TwistConstPtr)
ros::Subscriber sound_command_subscriber
#define ROS_WARN_STREAM_NAMED(name, args)
ecl::Slot< const WheelEvent & > slot_wheel_event
ecl::Slot slot_controller_info