Ignition Gazebo

API Reference

4.1.0
Visualization.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef IGNITION_GAZEBO_SYSTEMS_OPTICAL_TACTILE_PLUGIN_VISUALIZATION_HH_
19 #define IGNITION_GAZEBO_SYSTEMS_OPTICAL_TACTILE_PLUGIN_VISUALIZATION_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include <ignition/gazebo/config.hh>
25 #include <ignition/gazebo/Export.hh>
27 
28 namespace ignition
29 {
30 namespace gazebo
31 {
32 // Inline bracket to help doxygen filtering.
33 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE
34 {
35 namespace systems
36 {
37 namespace optical_tactile_sensor
38 {
39  // This class handles the configuration and process of visualizing the
40  // different elements needed for the Optical Tactile Sensor plugin
42  {
52  std::string &_modelName,
53  ignition::math::Vector3d &_sensorSize,
54  double &_forceLength,
55  float &_cameraUpdateRate,
56  ignition::math::Pose3f &_depthCameraOffset,
57  int &_visualizationResolution);
58 
62  private: void InitializeSensorMarkerMsg(
63  ignition::msgs::Marker &_sensorMarkerMsg);
64 
69  public: void RequestSensorMarkerMsg(
70  ignition::math::Pose3f const &_sensorPose);
71 
77  private: void InitializeNormalForcesMarkerMsgs(
78  ignition::msgs::Marker &_positionMarkerMsg,
79  ignition::msgs::Marker &_forceMarkerMsg);
80 
93  public: void AddNormalForceToMarkerMsgs(
94  ignition::msgs::Marker &_positionMarkerMsg,
95  ignition::msgs::Marker &_forceMarkerMsg,
96  ignition::math::Vector3f &_position,
97  ignition::math::Vector3f &_normalForce,
98  ignition::math::Pose3f &_sensorWorldPose);
99 
106  public: void RequestNormalForcesMarkerMsgs(
107  ignition::msgs::Marker &_positionMarkerMsg,
108  ignition::msgs::Marker &_forceMarkerMsg);
109 
111  private: ignition::transport::Node node;
112 
114  private: std::string modelName;
115 
117  private: ignition::math::Vector3d sensorSize;
118 
120  private: double forceLength;
121 
123  private: float cameraUpdateRate;
124 
126  private: ignition::math::Pose3f depthCameraOffset;
127 
129  private: int visualizationResolution;
130 
132  private: bool normalForcesMsgsAreInitialized{false};
133  };
134 }
135 }
136 }
137 }
138 }
139 
140 #endif
void RequestNormalForcesMarkerMsgs(ignition::msgs::Marker &_positionMarkerMsg, ignition::msgs::Marker &_forceMarkerMsg)
Request the "/marker" service for the marker messages representing the normal forces.
STL class.
OpticalTactilePluginVisualization(std::string &_modelName, ignition::math::Vector3d &_sensorSize, double &_forceLength, float &_cameraUpdateRate, ignition::math::Pose3f &_depthCameraOffset, int &_visualizationResolution)
Constructor.
void AddNormalForceToMarkerMsgs(ignition::msgs::Marker &_positionMarkerMsg, ignition::msgs::Marker &_forceMarkerMsg, ignition::math::Vector3f &_position, ignition::math::Vector3f &_normalForce, ignition::math::Pose3f &_sensorWorldPose)
Add a normal force to the marker messages representing the normal forces computed.
void RequestSensorMarkerMsg(ignition::math::Pose3f const &_sensorPose)
Request the "/marker" service for the sensor marker. This can be helpful when debbuging, given that there shouldn&#39;t be a visual tag in the plugin&#39;s model.
This library is part of the Ignition Robotics project.