Drake
frame_visualizer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
8 #include "drake/lcmt_viewer_draw.hpp"
11 
12 namespace drake {
13 namespace systems {
14 
22 class FrameVisualizer : public LeafSystem<double> {
23  public:
25 
26 
36  const std::vector<RigidBodyFrame<double>>& local_transforms,
38 
44  void set_publish_period(double period) {
45  this->DeclarePeriodicPublish(period);
46  }
47 
48  private:
49  void DoPublish(
50  const systems::Context<double>& context,
51  const std::vector<const PublishEvent<double>*>&) const override;
52 
53  const RigidBodyTree<double>& tree_;
55  const std::vector<RigidBodyFrame<double>> local_transforms_;
56 
57  drake::lcmt_viewer_draw default_msg_{};
58 };
59 
60 } // namespace systems
61 } // namespace drake
void DeclarePeriodicPublish(double period_sec, double offset_sec=0)
Declares a periodic publish event with period = period_sec and offset = offset_sec.
Definition: leaf_system.h:663
Definition: automotive_demo.cc:88
std::vector< double > vector
Definition: translator_test.cc:20
A pure virtual interface that enables LCM to be mocked.
Definition: drake_lcm_interface.h:14
A superclass template that extends System with some convenience utilities that are not applicable to ...
Definition: leaf_system.h:82
FrameVisualizer(const FrameVisualizer &)=delete
This is a Drake System block that takes in a state vector, and outputs a drake::lcmt_viewer_draw mess...
Definition: frame_visualizer.h:22
This class represents a publish event.
Definition: event.h:194
#define DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(Classname)
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN deletes the special member functions for copy-construction, copy-assignment, move-construction, and move-assignment.
Definition: drake_copyable.h:35
void set_publish_period(double period)
Sets the publishing period of this system.
Definition: frame_visualizer.h:44
Provides careful macros to selectively enable or disable the special member functions for copy-constr...