00001 /* 00002 * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA) 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 00018 // CobGazeboRosControlPlugin 00019 #include <gazebo_ros_control/gazebo_ros_control_plugin.h> 00020 #include <cob_gazebo_ros_control/hwi_switch_robot_hw_sim.h> 00021 00022 00023 namespace cob_gazebo_ros_control 00024 { 00025 00026 class HWISwitchGazeboRosControlPlugin : public gazebo_ros_control::GazeboRosControlPlugin 00027 { 00028 public: 00029 00030 // Overloaded Gazebo entry point 00031 virtual void Load(gazebo::physics::ModelPtr parent, sdf::ElementPtr sdf); 00032 00033 // Called by the world update start event 00034 void Update(); 00035 00036 protected: 00037 void eStopCB(const std_msgs::BoolConstPtr& e_stop_active); 00038 void stateValidCB(const std_msgs::BoolConstPtr& state_valid); 00039 00040 bool enable_joint_filtering_; 00041 std::string filterJointsParam_; 00042 00043 boost::shared_ptr<cob_gazebo_ros_control::HWISwitchRobotHWSim> hwi_switch_robot_hw_sim_; 00044 00045 bool state_valid_; 00046 ros::Subscriber state_valid_sub_; 00047 }; 00048 00049 00050 }