vpROSRobot.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * $Id: vpROSRobot.h 3778 2012-10-31 14:12:07Z fpasteau $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2012 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * vpRobot implementation for ROS middleware.
36  *
37  * Authors:
38  * Francois Pasteau
39  * Fabien Spindler
40  *
41  *****************************************************************************/
42 
43 #ifndef vpROSRobot_h
44 #define vpROSRobot_h
45 
51 #include <visp3/robot/vpRobot.h>
52 
53 #include <geometry_msgs/Twist.h>
54 #include <nav_msgs/Odometry.h>
55 #include <ros/ros.h>
56 
62 class VISP_EXPORT vpROSRobot : public vpRobot
63 {
64 protected:
69 
71 
73  vpTranslationVector p;
74  vpColVector pose_prev;
75  vpColVector displacement;
76  uint32_t _sec, _nsec;
77  volatile bool odom_mutex;
78  std::string _master_uri;
79  std::string _topic_cmd;
80  std::string _topic_odom;
81  std::string _nodespace;
82 
83 private: // Set as private since not implemented
84  void get_eJe( vpMatrix &eJe ) {}
85 
86  vpROSRobot( const vpROSRobot &robot );
91  void get_fJe( vpMatrix & /*fJe*/ ) {}
92 
97  void getArticularDisplacement( vpColVector & /*qdot*/ ){};
98 
99  void getVelocity( const vpRobot::vpControlFrameType frame, vpColVector &velocity );
100  vpColVector getVelocity( const vpRobot::vpControlFrameType frame );
101 
106  void setPosition( const vpRobot::vpControlFrameType /*frame*/, const vpColVector & /*q*/ ){};
107  void odomCallback( const nav_msgs::Odometry::ConstPtr &msg );
108  void getCameraDisplacement( vpColVector & /*v*/ );
109 
110 public:
112  vpROSRobot();
114  virtual ~vpROSRobot();
115 
116  void getDisplacement( const vpRobot::vpControlFrameType /*frame*/, vpColVector & /*q*/ );
117  void getDisplacement( const vpRobot::vpControlFrameType /*frame*/, vpColVector & /*q*/, struct timespec &timestamp );
118  void getPosition( const vpRobot::vpControlFrameType /*frame*/, vpColVector & /*q*/ );
119 
121  void init();
122  void init( int argc, char **argv );
123 
124  void setVelocity( const vpRobot::vpControlFrameType frame, const vpColVector &vel );
125  void stopMotion();
126  void setCmdVelTopic( std::string topic_name );
127  void setOdomTopic( std::string topic_name );
128  void setMasterURI( std::string master_uri );
129  void setNodespace( std::string nodespace );
130 };
131 
132 #endif
volatile bool odom_mutex
Definition: vpROSRobot.h:77
void init(const M_string &remappings)
vpColVector pose_prev
Definition: vpROSRobot.h:74
ros::AsyncSpinner * spinner
Definition: vpROSRobot.h:68
ros::NodeHandle * n
Definition: vpROSRobot.h:65
std::string _topic_odom
Definition: vpROSRobot.h:80
Interface for robots based on ROS.
Definition: vpROSRobot.h:62
ros::Publisher cmdvel
Definition: vpROSRobot.h:66
void setPosition(const vpRobot::vpControlFrameType, const vpColVector &)
Definition: vpROSRobot.h:106
void get_fJe(vpMatrix &)
Definition: vpROSRobot.h:91
ros::Subscriber odom
Definition: vpROSRobot.h:67
bool isInitialized
Definition: vpROSRobot.h:70
void get_eJe(vpMatrix &eJe)
Definition: vpROSRobot.h:84
void getArticularDisplacement(vpColVector &)
Definition: vpROSRobot.h:97
std::string _master_uri
Definition: vpROSRobot.h:78
vpColVector displacement
Definition: vpROSRobot.h:75
std::string _topic_cmd
Definition: vpROSRobot.h:79
vpQuaternionVector q
Definition: vpROSRobot.h:72
uint32_t _sec
Definition: vpROSRobot.h:76
std::string _nodespace
Definition: vpROSRobot.h:81
vpTranslationVector p
Definition: vpROSRobot.h:73


visp_ros
Author(s): Francois Pasteau, Fabien Spindler, Gatien Gaumerais, Alexander Oliva
autogenerated on Tue Mar 1 2022 00:03:22