Fawkes API
Fawkes Development Version
gazebo.cpp
1
2
/***************************************************************************
3
* gazebo.cpp - Gazebo aspect for Fawkes
4
*
5
* Created: Fri Aug 24 09:24:31 2012
6
* Author Bastian Klingen, Frederik Zwilling
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#include <plugins/gazebo/aspect/gazebo.h>
25
26
#include <stdio.h>
27
28
namespace
fawkes
{
29
30
/** @class GazeboAspect <plugins/gazebo/aspect/gazebo.h>
31
* Thread aspect to get access to a Gazebo node handle.
32
* Give this aspect to your thread to interact with the central Gazebo
33
* node handle.
34
* You can also control the simulation by sending messages
35
* via the provided publishers
36
*
37
* @ingroup Aspects
38
* @author Bastian Klingen, Frederik Zwilling
39
*/
40
41
/** @var fawkes:LockPtr<gazebo::NodeHandle> GazeboAspect::gazebonode
42
* Central Gazebo node handle. Make sure you use proper locking in your
43
* application when using the class, or chaos and havoc will come upon you.
44
*/
45
46
/** Constructor. */
47
GazeboAspect::GazeboAspect
()
48
{
49
add_aspect
(
"GazeboAspect"
);
50
}
51
52
/** Virtual empty destructor. */
53
GazeboAspect::~GazeboAspect
()
54
{
55
}
56
57
/** Init Gazebo aspect.
58
* This set the Gazebo node handle.
59
* It is guaranteed that this is called for an Gazebo Thread before start
60
* is called (when running regularly inside Fawkes).
61
* @param gazebonode Gazebo node handle
62
*/
63
void
64
GazeboAspect::init_GazeboAspect(gazebo::transport::NodePtr gazebonode,
65
gazebo::transport::NodePtr gazebo_world_node)
66
{
67
this->gazebonode =
gazebonode
;
68
this->gazebo_world_node =
gazebo_world_node
;
69
}
70
71
/** Finalize Gazebo aspect.
72
* This clears the Gazebo node handle.
73
*/
74
void
75
GazeboAspect::finalize_GazeboAspect()
76
{
77
gazebonode
.reset();
78
}
79
80
}
// end namespace fawkes
fawkes::Aspect::add_aspect
void add_aspect(const char *name)
Add an aspect to a thread.
Definition:
aspect.cpp:53
fawkes::GazeboAspect::GazeboAspect
GazeboAspect()
Constructor.
Definition:
gazebo.cpp:51
fawkes::GazeboAspect::gazebonode
gazebo::transport::NodePtr gazebonode
Gazebo Node for communication with a robot.
Definition:
gazebo.h:50
fawkes
fawkes::GazeboAspect::gazebo_world_node
gazebo::transport::NodePtr gazebo_world_node
Gazebo Node for communication with the world (e.g.
Definition:
gazebo.h:55
fawkes::GazeboAspect::~GazeboAspect
virtual ~GazeboAspect()
Virtual empty destructor.
Definition:
gazebo.cpp:57
src
plugins
gazebo
aspect
gazebo.cpp
Generated by
1.8.16