hebiros_gazebo_plugin.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <gazebo/common/common.hh>
4 #include <gazebo/gazebo.hh>
5 #include <gazebo/physics/physics.hh>
6 #include <gazebo/transport/transport.hh>
7 #include <gazebo/msgs/msgs.hh>
8 
9 #include "ros/ros.h"
10 #include "sensor_msgs/JointState.h"
11 #include "std_srvs/Empty.h"
12 
13 #include "hebiros/FeedbackMsg.h"
14 #include "hebiros/CommandMsg.h"
15 #include "hebiros/AddGroupFromNamesSrv.h"
16 #include "hebiros/SetCommandLifetimeSrv.h"
17 #include "hebiros/SetFeedbackFrequencySrv.h"
18 
19 #include "hebiros_gazebo_group.h"
20 #include "hebiros_gazebo_joint.h"
22 
23 using namespace hebiros;
24 using namespace gazebo;
25 
26 class HebirosGazeboPlugin: public ModelPlugin {
27 
28 public:
29  HebirosGazeboPlugin() = default;
30 
31  void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
32  void OnUpdate(const common::UpdateInfo & _info);
33 
34 private:
35 
36  physics::ModelPtr model;
37  event::ConnectionPtr update_connection;
38  std::map<std::string, std::shared_ptr<HebirosGazeboGroup>> hebiros_groups;
39  std::map<std::string, std::shared_ptr<HebirosGazeboJoint>> hebiros_joints;
40 
41  std::string robot_namespace;
42  std::shared_ptr<ros::NodeHandle> n;
46 
47  void AddJointToGroup(std::shared_ptr<HebirosGazeboGroup> hebiros_group, std::string joint_name);
48  void UpdateGroup(std::shared_ptr<HebirosGazeboGroup> hebiros_group, const ros::Duration& iteration_time);
49 
50  bool SrvAddGroup(AddGroupFromNamesSrv::Request &req, AddGroupFromNamesSrv::Response &res);
51 
52 };
ros::ServiceServer add_group_srv
event::ConnectionPtr update_connection
std::map< std::string, std::shared_ptr< HebirosGazeboGroup > > hebiros_groups
ros::Subscriber command_sub
ros::ServiceServer acknowledge_srv
std::map< std::string, std::shared_ptr< HebirosGazeboJoint > > hebiros_joints
physics::ModelPtr model
std::shared_ptr< ros::NodeHandle > n


hebiros_gazebo_plugin
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:13:55