TransformPublisherDisplay.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016, Bielefeld University, CITEC
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  * Author: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
30  */
31 
32 #pragma once
33 
34 #include <rviz/display.h>
35 #include <ros/ros.h>
36 #include <visualization_msgs/InteractiveMarker.h>
37 #include <visualization_msgs/InteractiveMarkerFeedback.h>
38 #include <geometry_msgs/PoseStamped.h>
39 #include <tf2/buffer_core.h>
40 
41 // forward declarations of classes
42 namespace rviz {
43 class Property;
44 class StringProperty;
45 class BoolProperty;
46 class FloatProperty;
47 class VectorProperty;
48 class TfFrameProperty;
49 class EnumProperty;
50 
51 class InteractiveMarker;
52 } // namespace rviz
53 
55 
56 namespace agni_tf_tools {
57 
58 class RotationProperty;
59 
61 {
62  Q_OBJECT
63 
64 public:
66  ~TransformPublisherDisplay() override;
67 
68  void reset() override;
69 
70 protected:
71  void onInitialize() override;
72  void onEnable() override;
73  void onDisable() override;
74  void update(float wall_dt, float ros_dt) override;
75 
76  void addFrameControls(visualization_msgs::InteractiveMarker& im, double scale, bool interactive);
77  void add6DOFControls(visualization_msgs::InteractiveMarker& im);
78  bool createInteractiveMarker(int type);
79  bool fillPoseStamped(std_msgs::Header& header, geometry_msgs::Pose& pose);
80  void cancelTFRequest();
81 
82 protected Q_SLOTS:
83  void onRefFrameChanged();
85  void onFramesChanged();
86  void onTransformChanged();
87  void onMarkerFeedback(visualization_msgs::InteractiveMarkerFeedback& feedback);
89  void onMarkerTypeChanged();
90  void onMarkerScaleChanged();
91 
92 private:
93  // properties
99  std::string prev_parent_frame_;
103 
104  // tf publisher
108 
109  // interactive marker stuff
112 };
113 
114 } // namespace agni_tf_tools
agni_tf_tools::TransformPublisherDisplay::cancelTFRequest
void cancelTFRequest()
Definition: TransformPublisherDisplay.cpp:273
agni_tf_tools::TransformPublisherDisplay::onAdaptTransformChanged
void onAdaptTransformChanged()
Definition: TransformPublisherDisplay.cpp:335
agni_tf_tools::TransformPublisherDisplay::tf_callback_handle_
tf2::TransformableCallbackHandle tf_callback_handle_
Definition: TransformPublisherDisplay.h:106
agni_tf_tools::TransformPublisherDisplay::onTransformChanged
void onTransformChanged()
Definition: TransformPublisherDisplay.cpp:359
agni_tf_tools::TransformPublisherDisplay::onDisable
void onDisable() override
Definition: TransformPublisherDisplay.cpp:138
boost::shared_ptr< rviz::InteractiveMarker >
agni_tf_tools::TransformPublisherDisplay::update
void update(float wall_dt, float ros_dt) override
Definition: TransformPublisherDisplay.cpp:144
agni_tf_tools::TransformPublisherDisplay::createInteractiveMarker
bool createInteractiveMarker(int type)
Definition: TransformPublisherDisplay.cpp:232
agni_tf_tools::TransformPublisherDisplay::TransformPublisherDisplay
TransformPublisherDisplay()
Definition: TransformPublisherDisplay.cpp:71
agni_tf_tools::TransformPublisherDisplay::imarker_
boost::shared_ptr< rviz::InteractiveMarker > imarker_
Definition: TransformPublisherDisplay.h:110
agni_tf_tools::TransformPublisherDisplay::onMarkerScaleChanged
void onMarkerScaleChanged()
Definition: TransformPublisherDisplay.cpp:412
ros.h
agni_tf_tools::TransformPublisherDisplay
Definition: TransformPublisherDisplay.h:60
rviz::BoolProperty
agni_tf_tools::TransformPublisherDisplay::ignore_updates_
bool ignore_updates_
Definition: TransformPublisherDisplay.h:111
agni_tf_tools::TransformPublisherDisplay::onInitialize
void onInitialize() override
Definition: TransformPublisherDisplay.cpp:116
agni_tf_tools::TransformPublisherDisplay::onEnable
void onEnable() override
Definition: TransformPublisherDisplay.cpp:132
agni_tf_tools::TransformPublisherDisplay::onBroadcastEnableChanged
void onBroadcastEnableChanged()
Definition: TransformPublisherDisplay.cpp:404
display.h
agni_tf_tools::TransformPublisherDisplay::add6DOFControls
void add6DOFControls(visualization_msgs::InteractiveMarker &im)
Definition: TransformPublisherDisplay.cpp:203
agni_tf_tools
Definition: rotation_property.cpp:36
agni_tf_tools::TransformPublisherDisplay::reset
void reset() override
Definition: TransformPublisherDisplay.cpp:128
rviz::Display
rviz::EnumProperty
rviz::FloatProperty
agni_tf_tools::TransformPublisherDisplay::broadcast_property_
rviz::BoolProperty * broadcast_property_
Definition: TransformPublisherDisplay.h:96
agni_tf_tools::TransformPublisherDisplay::adapt_transform_property_
rviz::BoolProperty * adapt_transform_property_
Definition: TransformPublisherDisplay.h:98
rviz
tf2::TransformableRequestHandle
uint64_t TransformableRequestHandle
agni_tf_tools::TransformPublisherDisplay::parent_frame_property_
rviz::TfFrameProperty * parent_frame_property_
Definition: TransformPublisherDisplay.h:97
buffer_core.h
agni_tf_tools::TransformPublisherDisplay::onMarkerTypeChanged
void onMarkerTypeChanged()
Definition: TransformPublisherDisplay.cpp:408
agni_tf_tools::TransformPublisherDisplay::marker_scale_property_
rviz::FloatProperty * marker_scale_property_
Definition: TransformPublisherDisplay.h:102
agni_tf_tools::TransformPublisherDisplay::tf_pub_
TransformBroadcaster * tf_pub_
Definition: TransformPublisherDisplay.h:105
agni_tf_tools::TransformPublisherDisplay::translation_property_
rviz::VectorProperty * translation_property_
Definition: TransformPublisherDisplay.h:94
rviz::TfFrameProperty
TransformBroadcaster
Definition: TransformBroadcaster.h:42
agni_tf_tools::TransformPublisherDisplay::~TransformPublisherDisplay
~TransformPublisherDisplay() override
Definition: TransformPublisherDisplay.cpp:112
agni_tf_tools::TransformPublisherDisplay::prev_parent_frame_
std::string prev_parent_frame_
Definition: TransformPublisherDisplay.h:99
agni_tf_tools::RotationProperty
Definition: rotation_property.h:45
agni_tf_tools::TransformPublisherDisplay::rotation_property_
RotationProperty * rotation_property_
Definition: TransformPublisherDisplay.h:95
agni_tf_tools::TransformPublisherDisplay::tf_request_handle_
tf2::TransformableRequestHandle tf_request_handle_
Definition: TransformPublisherDisplay.h:107
agni_tf_tools::TransformPublisherDisplay::onMarkerFeedback
void onMarkerFeedback(visualization_msgs::InteractiveMarkerFeedback &feedback)
Definition: TransformPublisherDisplay.cpp:373
agni_tf_tools::TransformPublisherDisplay::onRefFrameChanged
void onRefFrameChanged()
Definition: TransformPublisherDisplay.cpp:314
agni_tf_tools::TransformPublisherDisplay::fillPoseStamped
bool fillPoseStamped(std_msgs::Header &header, geometry_msgs::Pose &pose)
Definition: TransformPublisherDisplay.cpp:280
rviz::VectorProperty
header
const std::string header
agni_tf_tools::TransformPublisherDisplay::marker_property_
rviz::EnumProperty * marker_property_
Definition: TransformPublisherDisplay.h:101
agni_tf_tools::TransformPublisherDisplay::child_frame_property_
rviz::TfFrameProperty * child_frame_property_
Definition: TransformPublisherDisplay.h:100
agni_tf_tools::TransformPublisherDisplay::addFrameControls
void addFrameControls(visualization_msgs::InteractiveMarker &im, double scale, bool interactive)
Definition: TransformPublisherDisplay.cpp:183
agni_tf_tools::TransformPublisherDisplay::onFramesChanged
void onFramesChanged()
Definition: TransformPublisherDisplay.cpp:342
tf2::TransformableCallbackHandle
uint32_t TransformableCallbackHandle


agni_tf_tools
Author(s): Robert Haschke
autogenerated on Tue Oct 15 2024 02:57:48