SVHEncoderSettings.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of the SCHUNK SVH Driver suite.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2014 SCHUNK Mobile Greifsysteme GmbH, Lauffen/Neckar Germany
12 // © Copyright 2014 FZI Forschungszentrum Informatik, Karlsruhe, Germany
13 //
14 // -- END LICENSE BLOCK ------------------------------------------------
15 
16 //----------------------------------------------------------------------
28 //----------------------------------------------------------------------
29 #ifndef SVHENCODERSETTINGS_H
30 #define SVHENCODERSETTINGS_H
31 
32 
33 namespace driver_svh {
34 
39 
41  std::vector<uint32_t> scalings;
42 
43  // TODO Provide a constructor that allows for seperate encoder settings in the hardware
49  scalings(9,_scaling)
50  {}
51 
53  bool operator == (const SVHEncoderSettings& other) const
54  {
55  return (scalings == other.scalings);
56  }
57 };
58 
59 
61 inline icl_comm::ArrayBuilder& operator << (icl_comm::ArrayBuilder& ab, const SVHEncoderSettings& data)
62 {
63  // Trivial as the vector slicing is already done by the arraybuilder
64  ab << data.scalings;
65  return ab;
66 }
67 
69 inline icl_comm::ArrayBuilder& operator >> (icl_comm::ArrayBuilder& ab, SVHEncoderSettings& data)
70 {
71  ab >> data.scalings;
72  return ab;
73 }
74 
75 
77 inline std::ostream& operator << (std::ostream& o, const SVHEncoderSettings& es)
78 {
79  o << "Scalings: ";
80  for (size_t i = 0; i < es.scalings.size(); i++)
81  {
82  o << (int)i << ":" <<es.scalings[i] << " ";
83  }
84 
85  o << std::endl;
86  return o;
87 }
88 
89 }
90 #endif // SVHENCODERSETTINGS_H
unsigned int uint32_t
icl_comm::ArrayBuilder & operator>>(icl_comm::ArrayBuilder &ab, SVHControlCommand &data)
overload stream operator to easily deserialize control commands for one channel
std::vector< uint32_t > scalings
encoderSettings consist of multipliers for each encoder
SVHEncoderSettings(uint32_t _scaling=1)
SVHEncoderSettings Default CTOR will assign 9x1 to the scalings if no argument is given...
icl_comm::ArrayBuilder & operator<<(icl_comm::ArrayBuilder &ab, const SVHControlCommand &data)
bool operator==(const SVHEncoderSettings &other) const
Compares two SVHEncoderSettings objects.
The SVHEncoderSettings hold the settings for the encoder scaling of each channel. ...


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Mon Jun 10 2019 15:04:59