Robot.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include "ElementOps.h"
6 
7 namespace armarx::viz
8 {
9 
10  class Robot : public ElementOps<Robot, data::ElementRobot>
11  {
12  public:
14 
15  Robot&
16  file(std::string const& project, std::string const& filename)
17  {
18  data_->project = project;
19  data_->filename = filename;
20 
21  return *this;
22  }
23 
24  Robot&
25  file(const armarx::PackagePath& packagePath)
26  {
27  data_->project = packagePath.serialize().package;
28  data_->filename = packagePath.serialize().package + "/" + packagePath.serialize().path;
29 
30  return *this;
31  }
32 
33  Robot&
35  {
36  data_->drawStyle |= data::ModelDrawStyle::COLLISION;
37 
38  return *this;
39  }
40 
41  Robot&
43  {
44  data_->drawStyle &= ~data::ModelDrawStyle::COLLISION;
45 
46  return *this;
47  }
48 
49  Robot&
51  {
52  data_->drawStyle |= data::ModelDrawStyle::OVERRIDE_COLOR;
53 
54  return color(c);
55  }
56 
57  Robot&
59  {
60  data_->drawStyle &= ~data::ModelDrawStyle::OVERRIDE_COLOR;
61 
62  return *this;
63  }
64 
65  Robot&
66  joint(std::string const& name, float value)
67  {
68  data_->jointValues[name] = value;
69 
70  return *this;
71  }
72 
73  Robot&
74  joints(std::map<std::string, float> const& values)
75  {
76  data_->jointValues = values;
77 
78  return *this;
79  }
80  };
81 
82 } // namespace armarx::viz
ElementOps.h
armarx::viz::Robot::file
Robot & file(std::string const &project, std::string const &filename)
Definition: Robot.h:16
armarx::viz::Robot::joint
Robot & joint(std::string const &name, float value)
Definition: Robot.h:66
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
armarx::viz::ElementOps< Robot, data::ElementRobot >::data_
IceInternal::Handle< data::ElementRobot > data_
Definition: ElementOps.h:315
project
std::string project
Definition: VisualizationRobot.cpp:85
armarx::viz::Robot::useFullModel
Robot & useFullModel()
Definition: Robot.h:42
armarx::viz::Robot::file
Robot & file(const armarx::PackagePath &packagePath)
Definition: Robot.h:25
armarx::viz::ElementOps::ElementOps
ElementOps(std::string const &id)
Definition: ElementOps.h:119
armarx::PackagePath::serialize
data::PackagePath serialize() const
Definition: PackagePath.cpp:67
armarx::viz::ElementOps
Definition: ElementOps.h:116
armarx::viz::Robot::joints
Robot & joints(std::map< std::string, float > const &values)
Definition: Robot.h:74
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::viz::Color
Definition: Color.h:12
armarx::viz::Robot::useCollisionModel
Robot & useCollisionModel()
Definition: Robot.h:34
armarx::viz::Robot::overrideColor
Robot & overrideColor(Color c)
Definition: Robot.h:50
armarx::viz::Robot::useOriginalColor
Robot & useOriginalColor()
Definition: Robot.h:58
filename
std::string filename
Definition: VisualizationRobot.cpp:86
armarx::viz::Robot
Definition: Robot.h:10
armarx::viz::ElementOps< Robot, data::ElementRobot >::color
Robot & color(Color color)
Definition: ElementOps.h:218
armarx::PackagePath
Definition: PackagePath.h:52
armarx::viz
This file is part of ArmarX.
Definition: ArVizStorage.cpp:418
PackagePath.h