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 
44 #ifndef vpROSRobot_H
45 #define vpROSRobot_H
46 
52 #include <visp/vpRobot.h>
53 #include <ros/ros.h>
54 #include <nav_msgs/Odometry.h>
55 #include <geometry_msgs/Twist.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 
100  void getVelocity (const vpRobot::vpControlFrameType frame, vpColVector & velocity);
101  vpColVector getVelocity (const vpRobot::vpControlFrameType frame);
102 
107  void setPosition(const vpRobot::vpControlFrameType /*frame*/, const vpColVector &/*q*/) {};
108  void odomCallback(const nav_msgs::Odometry::ConstPtr& msg);
109  void getCameraDisplacement(vpColVector & /*v*/);
110 
111  public:
113  vpROSRobot() ;
115  virtual ~vpROSRobot() ;
116 
117  void getDisplacement(const vpRobot::vpControlFrameType /*frame*/, vpColVector &/*q*/);
118  void getDisplacement(const vpRobot::vpControlFrameType /*frame*/, vpColVector &/*q*/, struct timespec &timestamp);
119  void getPosition(const vpRobot::vpControlFrameType /*frame*/, vpColVector &/*q*/);
120 
122  void init() ;
123  void init(int argc, char **argv) ;
124 
125  void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel);
126  void stopMotion();
127  void setCmdVelTopic(std::string topic_name);
128  void setOdomTopic(std::string topic_name);
129  void setMasterURI(std::string master_uri);
130  void setNodespace(std::string nodespace);
131 } ;
132 
133 #endif
134 
135 
136 
volatile bool odom_mutex
Definition: vpROSRobot.h:77
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:107
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
autogenerated on Tue Feb 9 2021 03:40:20