RosGazeboModel.h
Go to the documentation of this file.
1 //| This file is a part of the ORCA framework.
2 //|
3 //| Copyright 2018, Fuzzy Logic Robotics
4 //| Copyright 2017, ISIR / Universite Pierre et Marie Curie (UPMC)
5 //|
6 //| Main contributor(s): Antoine Hoarau, Ryan Lober, and
7 //| Fuzzy Logic Robotics <info@fuzzylogicrobotics.com>
8 //|
9 //| ORCA is a whole-body reactive controller framework for robotics.
10 //|
11 //| This software is governed by the CeCILL-C license under French law and
12 //| abiding by the rules of distribution of free software. You can use,
13 //| modify and/ or redistribute the software under the terms of the CeCILL-C
14 //| license as circulated by CEA, CNRS and INRIA at the following URL
15 //| "http://www.cecill.info".
16 //|
17 //| As a counterpart to the access to the source code and rights to copy,
18 //| modify and redistribute granted by the license, users are provided only
19 //| with a limited warranty and the software's author, the holder of the
20 //| economic rights, and the successive licensors have only limited
21 //| liability.
22 //|
23 //| In this respect, the user's attention is drawn to the risks associated
24 //| with loading, using, modifying and/or developing or reproducing the
25 //| software by the user in light of its specific status of free software,
26 //| that may mean that it is complicated to manipulate, and that also
27 //| therefore means that it is reserved for developers and experienced
28 //| professionals having in-depth computer knowledge. Users are therefore
29 //| encouraged to load and test the software's suitability as regards their
30 //| requirements in conditions enabling the security of their systems and/or
31 //| data to be ensured and, more generally, to use and operate it in the
32 //| same conditions as regards security.
33 //|
34 //| The fact that you are presently reading this means that you have had
35 //| knowledge of the CeCILL-C license and that you accept its terms.
36 
37 #pragma once
38 
39 #include <orca_ros/orca_ros.h>
40 #include <orca/gazebo/GazeboServer.h>
41 #include <orca/gazebo/GazeboModel.h>
42 #include <orca/robot/RobotModel.h>
43 
44 namespace orca_ros
45 {
46 namespace gazebo
47 {
48 
50 {
51 public:
52  RosGazeboModel(std::shared_ptr<orca::gazebo::GazeboModel> gz_model
53  , std::shared_ptr<orca::robot::RobotModel> robot_kinematics);
54  void desiredTorqueSubscriberCb(const orca_ros::JointTorqueCommand::ConstPtr& msg);
55  void publishRobotState();
56 private:
57  ros::Publisher state_pub_;
58  ros::Publisher joint_states_pub_;
59  ros::Subscriber desired_torque_sub_;
60  Eigen::VectorXd torque_command_;
61  std::shared_ptr<orca::gazebo::GazeboModel> gz_model_;
62  orca_ros::RobotState state_;
63  sensor_msgs::JointState joint_states_;
64  std::shared_ptr<orca::robot::RobotModel> robot_kinematics_;
65  bool robot_compensates_gravity_ = false;
66  bool first_command_received_ = false;
67 };
68 
69 } // namespace gazebo
70 } // namespace orca
Definition: RosWrapperBase.h:50
Definition: RosCartesianAccelerationPID.h:42
void desiredTorqueSubscriberCb(const orca_ros::JointTorqueCommand::ConstPtr &msg)
Definition: RosGazeboModel.cc:95
RosGazeboModel(std::shared_ptr< orca::gazebo::GazeboModel > gz_model, std::shared_ptr< orca::robot::RobotModel > robot_kinematics)
Definition: RosGazeboModel.cc:7
void publishRobotState()
Definition: RosGazeboModel.cc:64
Definition: RosGazeboModel.h:49