Main Page
Namespaces
Namespace List
Namespace Members
All
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
f
g
i
l
m
o
p
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
f
g
i
l
m
o
p
r
s
t
u
v
w
~
Variables
_
a
f
i
x
y
z
Typedefs
Files
File List
File Members
All
Functions
Enumerations
Enumerator
Macros
test
minimal_test.cpp
Go to the documentation of this file.
1
/*********************************************************************
2
*
3
* Software License Agreement
4
*
5
* Copyright (c) 2018, Simbe Robotics, Inc.
6
* All rights reserved.
7
*
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions
10
* are met:
11
*
12
* * Redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer.
14
* * Redistributions in binary form must reproduce the above
15
* copyright notice, this list of conditions and the following
16
* disclaimer in the documentation and/or other materials provided
17
* with the distribution.
18
* * Neither the name of Simbe Robotics, Inc. nor the names of its
19
* contributors may be used to endorse or promote products derived
20
* from this software without specific prior written permission.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
* POSSIBILITY OF SUCH DAMAGE.
34
*
35
* Author: Steve Macenski (steven.macenski@simberobotics.com)
36
* Purpose: Test minimum configuration of costmap_2d
37
/*********************************************************************/
38
39
40
#include <
ros/ros.h
>
41
#include <
costmap_2d/costmap_2d_ros.h
>
42
#include <
tf/transform_broadcaster.h
>
43
#include <thread>
44
45
#include "
tf2_ros/transform_listener.h
"
46
#include "
tf2_ros/message_filter.h
"
47
#include "
message_filters/subscriber.h
"
48
#include "
tf2_geometry_msgs/tf2_geometry_msgs.h
"
49
50
51
/*****************************************************************************/
52
void
TransformThread
()
53
/*****************************************************************************/
54
{
55
tf::TransformBroadcaster
tfB;
56
tf::Transform
transform;
57
transform.
setIdentity
();
58
transform.
setOrigin
(tf::Vector3(2.,2.,0.));
59
60
ros::Rate
r(20);
61
while
(
ros::ok
())
62
{
63
tfB.
sendTransform
(
tf::StampedTransform
(transform,
ros::Time::now
(), \
64
"map"
,
"base_link"
));
65
tfB.
sendTransform
(
tf::StampedTransform
(transform,
ros::Time::now
(), \
66
"base_link"
,
"camera_link"
));
67
r.
sleep
();
68
ros::spinOnce
();
69
}
70
}
71
72
/*****************************************************************************/
73
int
main
(
int
argc,
char
**argv)
74
/*****************************************************************************/
75
{
76
ros::init
(argc, argv,
"STVL_minimal_test"
);
77
78
tf2_ros::Buffer
tf_buffer
;
79
tf2_ros::TransformListener
_tf2(
tf_buffer
);
80
std::thread
t
(
TransformThread
);
81
82
costmap_2d::Costmap2DROS
costmap(
"global_costmap"
,
tf_buffer
);
83
costmap.
start
();
84
85
ros::Rate
r(10);
86
while
(
ros::ok
())
87
{
88
// then make a thread to do something with a costmap pointer...
89
ros::spinOnce
();
90
r.
sleep
();
91
}
92
return
1;
93
}
TransformThread
void TransformThread()
Definition:
minimal_test.cpp:52
tf::TransformBroadcaster::sendTransform
void sendTransform(const geometry_msgs::TransformStamped &transform)
ros::init
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
ros.h
ros::spinOnce
ROSCPP_DECL void spinOnce()
tf::StampedTransform
costmap_2d_ros.h
ros::ok
ROSCPP_DECL bool ok()
transform_broadcaster.h
tf2_ros::TransformListener
message_filter.h
tf::TransformBroadcaster
subscriber.h
tf2_ros::Buffer
tf::Transform
tf::Transform::setOrigin
TFSIMD_FORCE_INLINE void setOrigin(const Vector3 &origin)
ros::Rate::sleep
bool sleep()
costmap_2d::Costmap2DROS::start
void start()
transform_listener.h
main
int main(int argc, char **argv)
Definition:
minimal_test.cpp:73
tf_buffer
tf2_ros::Buffer * tf_buffer
tf::Transform::setIdentity
void setIdentity()
tf2_geometry_msgs.h
ros::Rate
costmap_2d::Costmap2DROS
t
geometry_msgs::TransformStamped t
ros::Time::now
static Time now()
spatio_temporal_voxel_layer
Author(s):
autogenerated on Wed Aug 16 2023 02:10:02