##

IntrospectionCurveHandler.hh
Go to the documentation of this file.
/*
* Copyright (C) 2016 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_GUI_PLOT_INTROSPECTIONCURVEHANDLER_HH_
#define GAZEBO_GUI_PLOT_INTROSPECTIONCURVEHANDLER_HH_
#include <memory>
#include <string>
#include <ignition/math/Vector3.hh>
#include <ignition/math/Quaternion.hh>
#include "gazebo/msgs/msgs.hh"
#include "gazebo/gui/plot/PlottingTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
// Forward declare private data class
class IntrospectionCurveHandlerPrivate;
class GZ_GUI_VISIBLE IntrospectionCurveHandler
{
public: IntrospectionCurveHandler();
public: ~IntrospectionCurveHandler();
public: void AddCurve(const std::string &_query, PlotCurveWeakPtr _curve);
public: void RemoveCurve(PlotCurveWeakPtr _curve);
public: unsigned int CurveCount() const;
public: void SetPaused(const bool _paused);
public: bool Initialized() const;
private: void SetupIntrospection();
private: void OnIntrospection(const gazebo::msgs::Param_V &_msg);
private: bool Vector3dFromQuery(const std::string &_query,
const ignition::math::Vector3d &_vec, double &_value) const;
private: bool QuaterniondFromQuery(const std::string &_query,
const ignition::math::Quaterniond &_quat, double &_value) const;
private: void AddItemToFilter(const std::string &_name,
const std::function<void(const bool _result)> &_cb = nullptr);
private: void RemoveItemFromFilter(const std::string &_name,
const std::function<void(const bool _result)> &_cb = nullptr);
private: std::unique_ptr<IntrospectionCurveHandlerPrivate> dataPtr;
};
}
}
#endif
gazebo::gui::IntrospectionCurveHandler::IntrospectionCurveHandler
IntrospectionCurveHandler()
Constructor.
PlottingTypes.hh
default namespace for gazebo
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::gui::IntrospectionCurveHandler::SetPaused
void SetPaused(const bool _paused)
Set whether or not to pause updating the plot curves.
gazebo::gui::IntrospectionCurveHandler
Manages and updates curves based on introspection data.
Definition: IntrospectionCurveHandler.hh:38
system.hh
msgs.hh
gazebo::gui::IntrospectionCurveHandler::AddCurve
void AddCurve(const std::string &_query, PlotCurveWeakPtr _curve)
Add a curve to be updated.
gazebo::common::Param_V
std::vector< common::Param * > Param_V
Definition: CommonTypes.hh:97
gazebo::gui::IntrospectionCurveHandler::RemoveCurve
void RemoveCurve(PlotCurveWeakPtr _curve)
Remove a curve from the topic data hander.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::IntrospectionCurveHandler::Initialized
bool Initialized() const
Get whether or not the introspection curve handler has been initialized.
gazebo::gui::PlotCurveWeakPtr
std::weak_ptr< PlotCurve > PlotCurveWeakPtr
Definition: PlottingTypes.hh:41
gazebo::gui::IntrospectionCurveHandler::CurveCount
unsigned int CurveCount() const
Get the number of curves managed by this handler.
gazebo::gui::IntrospectionCurveHandler::~IntrospectionCurveHandler
~IntrospectionCurveHandler()
Destructor.