robot_hw_sim.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2013, Open Source Robotics Foundation
5  * Copyright (c) 2013, The Johns Hopkins University
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of the Open Source Robotics Foundation
19  * nor the names of its contributors may be
20  * used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *********************************************************************/
36 
38 
41 
42 #ifndef __ROS_CONTROL_GAZEBO_ROBOT_HW_SIM_H
43 #define __ROS_CONTROL_GAZEBO_ROBOT_HW_SIM_H
44 
45 #include <gazebo/physics/physics.hh>
46 #include <ros/ros.h>
49 #include <urdf/model.h>
50 
51 namespace gazebo_ros_control {
52 
53  // Struct for passing loaded joint data
54  struct JointData
55  {
56  std::string name_;
57  std::string hardware_interface_;
58 
59  JointData(const std::string& name, const std::string& hardware_interface) :
60  name_(name),
61  hardware_interface_(hardware_interface)
62  {}
63  };
64 
69  {
70  public:
71 
72  virtual ~RobotHWSim() { }
73 
85  virtual bool initSim(
86  const std::string& robot_namespace,
87  ros::NodeHandle model_nh,
88  gazebo::physics::ModelPtr parent_model,
89  const urdf::Model *const urdf_model,
90  std::vector<transmission_interface::TransmissionInfo> transmissions) = 0;
91 
98  virtual void readSim(ros::Time time, ros::Duration period) = 0;
99 
106  virtual void writeSim(ros::Time time, ros::Duration period) = 0;
107 
113  virtual void eStopActive(const bool active) {}
114 
115  };
116 
117 }
118 
119 #endif // ifndef __ROS_CONTROL_GAZEBO_ROBOT_HW_SIM_H
virtual void eStopActive(const bool active)
Set the emergency stop state.
Definition: robot_hw_sim.h:113
JointData(const std::string &name, const std::string &hardware_interface)
Definition: robot_hw_sim.h:59
Gazebo plugin version of RobotHW.
Definition: robot_hw_sim.h:68
Plugin template for hardware interfaces for ros_control and Gazebo.


gazebo_ros_control
Author(s): Jonathan Bohren, Dave Coleman
autogenerated on Wed Aug 24 2022 02:48:00