visualization.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 Roboception GmbH
3  *
4  * Author: Monika Florek-Jasinska
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright notice,
13  * this list of conditions and the following disclaimer in the documentation
14  * and/or other materials provided with the distribution.
15  *
16  * 3. Neither the name of the copyright holder nor the names of its contributors
17  * may be used to endorse or promote products derived from this software without
18  * specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef RC_PICK_CLIENT_PUBLISH_PICK_VISULIZATION_H
34 #define RC_PICK_CLIENT_PUBLISH_PICK_VISULIZATION_H
35 
36 #include <ros/ros.h>
37 #include <rc_pick_client/SuctionGrasp.h>
38 #include <visualization_msgs/MarkerArray.h>
40 #include <rc_pick_client/LoadCarrier.h>
41 #include <rc_pick_client/LoadCarrierWithFillingLevel.h>
42 #include <rc_pick_client/Item.h>
43 
45 
46 namespace pick_visualization
47 {
49 {
50 public:
51  explicit Visualization(const ros::NodeHandle& nh);
52 
54 
55  /*
56  * Remove previously published markers of this type.
57  * Publish grasps as tf frames (name: node_namespace/grasp_#) and marker spheres on topic grasp in node_namespace
58  * of size (max_suction_surface_length, max_suction_surface_width, 0)
59  */
60  void visualizeGrasps(const std::vector<rc_pick_client::SuctionGrasp>& ros_grasps);
61 
62  /*
63  * Remove previously published markers of this type.
64  * Publish load carrier position as tf frame (name: lc_#) and load carrier model as 5 cube markers on topic
65  * on topic lc in node_namespace
66  */
67  void visualizeLoadCarriers(const std::vector<rc_pick_client::LoadCarrier>& ros_lcs);
68 
69  /*
70  * Remove previously published markers of this type.
71  * Publish load carrier position as tf frame (name: lc_#) and load carrier model as 5 cube markers on topic
72  * on topic lc in node_namespace
73  */
74  void visualizeLoadCarriers(const std::vector<rc_pick_client::LoadCarrierWithFillingLevel>& ros_lcs);
75 
76  /*
77  * Remove previously published markers of this type.
78  * Publish box item position as tf frame (name: boxitem_#) and cube markers on topic boxitem in node_namespace
79  */
80  void visualizeDetectedBoxes(const std::vector<rc_pick_client::Item>& ros_boxitems);
81 
82  /*
83  * Remove previously published box item markers.
84  */
85  void deleteBoxItemMarkers();
86 
87  /*
88  * Remove previously published load carrier markers.
89  */
91 
92  /*
93  * Remove previously published grasp markers.
94  */
95  void deleteGraspMarkers();
96 
97 private:
99 
104  visualization_msgs::MarkerArray markers_lcs_;
105  visualization_msgs::MarkerArray markers_grasps_;
106  visualization_msgs::MarkerArray markers_boxes_;
107  /*
108  * Construct model of the load carrier that consist of 5 cube meshes representing 5 walls of the load carrier and
109  * append it to marker_array
110  */
111  static void constructLoadCarrier(visualization_msgs::MarkerArray& marker_array, const rc_pick_client::LoadCarrier& lc,
112  const int& lc_no);
113  /*
114  * Set markers characteristics
115  */
116  void setMarker(visualization_msgs::Marker& marker, const geometry_msgs::Pose& item_pose,
117  const rc_pick_client::Rectangle& rectangle, std::string frame_id, int marker_id);
118 
119  /*
120  * Publish given pose as tf frame
121  */
122  void publishTf(const geometry_msgs::Pose& ros_pose, std::string frame_id, std::string id);
123 };
124 } // namespace pick_visualization
125 
126 #endif // RC_PICK_CLIENT_PUBLISH_PICK_VISULIZATION_H
void visualizeGrasps(const std::vector< rc_pick_client::SuctionGrasp > &ros_grasps)
Visualization(const ros::NodeHandle &nh)
visualization_msgs::MarkerArray markers_lcs_
static void constructLoadCarrier(visualization_msgs::MarkerArray &marker_array, const rc_pick_client::LoadCarrier &lc, const int &lc_no)
void setMarker(visualization_msgs::Marker &marker, const geometry_msgs::Pose &item_pose, const rc_pick_client::Rectangle &rectangle, std::string frame_id, int marker_id)
void publishTf(const geometry_msgs::Pose &ros_pose, std::string frame_id, std::string id)
void visualizeDetectedBoxes(const std::vector< rc_pick_client::Item > &ros_boxitems)
visualization_msgs::MarkerArray markers_boxes_
void visualizeLoadCarriers(const std::vector< rc_pick_client::LoadCarrier > &ros_lcs)
tf::TransformBroadcaster br_
visualization_msgs::MarkerArray markers_grasps_


rc_pick_client
Author(s): Monika Florek-Jasinska
autogenerated on Sat Feb 13 2021 03:41:58