commander.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017, 2018 Simon Rasmussen (refactor)
3  *
4  * Copyright 2015, 2016 Thomas Timm Andersen (original version)
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #pragma once
20 #include <array>
21 #include <iomanip>
22 #include <sstream>
24 
26 {
27 private:
29 
30 protected:
31  bool write(const std::string &s);
32  void formatArray(std::ostringstream &out, std::array<double, 6> &values);
33 
34 public:
35  URCommander(URStream &stream) : stream_(stream)
36  {
37  }
38 
39  virtual bool speedj(std::array<double, 6> &speeds, double acceleration) = 0;
40  virtual bool setDigitalOut(uint8_t pin, bool value) = 0;
41  virtual bool setAnalogOut(uint8_t pin, double value) = 0;
42 
43  // shared
44  bool uploadProg(const std::string &s);
45  bool stopj(double a = 10.0);
46  bool setToolVoltage(uint8_t voltage);
47  bool setFlag(uint8_t pin, bool value);
48  bool setPayload(double value);
49 };
50 
52 {
53 public:
55  {
56  }
57 
58  virtual bool speedj(std::array<double, 6> &speeds, double acceleration);
59  virtual bool setDigitalOut(uint8_t pin, bool value);
60  virtual bool setAnalogOut(uint8_t pin, double value);
61 };
62 
64 {
65 public:
67  {
68  }
69 
70  virtual bool speedj(std::array<double, 6> &speeds, double acceleration) = 0;
71  virtual bool setDigitalOut(uint8_t pin, bool value);
72  virtual bool setAnalogOut(uint8_t pin, double value);
73 };
74 
76 {
77 public:
79  {
80  }
81 
82  virtual bool speedj(std::array<double, 6> &speeds, double acceleration);
83 };
84 
86 {
87 public:
89  {
90  }
91 
92  virtual bool speedj(std::array<double, 6> &speeds, double acceleration);
93 };
virtual bool setDigitalOut(uint8_t pin, bool value)=0
void formatArray(std::ostringstream &out, std::array< double, 6 > &values)
Definition: commander.cpp:30
URCommander(URStream &stream)
Definition: commander.h:35
bool uploadProg(const std::string &s)
Definition: commander.cpp:41
XmlRpcServer s
URStream & stream_
Definition: commander.h:28
bool setToolVoltage(uint8_t voltage)
Definition: commander.cpp:47
bool setPayload(double value)
Definition: commander.cpp:65
virtual bool speedj(std::array< double, 6 > &speeds, double acceleration)=0
URCommander_V3_1__2(URStream &stream)
Definition: commander.h:78
bool stopj(double a=10.0)
Definition: commander.cpp:73
bool write(const std::string &s)
Definition: commander.cpp:22
bool setFlag(uint8_t pin, bool value)
Definition: commander.cpp:58
URCommander_V1_X(URStream &stream)
Definition: commander.h:54
URCommander_V3_3(URStream &stream)
Definition: commander.h:88
virtual bool setAnalogOut(uint8_t pin, double value)=0
URCommander_V3_X(URStream &stream)
Definition: commander.h:66


ur_modern_driver
Author(s): Thomas Timm Andersen, Simon Rasmussen
autogenerated on Fri Jun 26 2020 03:37:00