controllers.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 
3 # Copyright (c) 2010-2011 Vanadium Labs LLC.
4 # All right reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 #
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # * Neither the name of Vanadium Labs LLC nor the names of its
15 # contributors may be used to endorse or promote products derived
16 # from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 # DISCLAIMED. IN NO EVENT SHALL VANADIUM LABS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 
29 
30 
31 
32 class Controller:
33 
34 
39  def __init__(self, device, name):
40  self.name = name
41  self.device = device
42  self.fake = device.fake
43  self.pause = False
44 
45  # output for joint states publisher
46  self.joint_names = list()
47  self.joint_positions = list()
48  self.joint_velocities = list()
49 
50 
51  def startup(self):
52  pass
53 
54 
55  def update(self):
56  pass
57 
58 
59  def shutdown(self):
60  pass
61 
62 
63  def active(self):
64  return False
65 
66 
69  def getDiagnostics(self):
70  msg = DiagnosticStatus()
71  msg.name = self.name
72  msg.level = DiagnosticStatus.OK
73  msg.message = "OK"
74  return msg
75 
arbotix_python.controllers.Controller.joint_names
joint_names
Definition: controllers.py:46
arbotix_python.controllers.Controller.update
def update(self)
Do any read/writes to device.
Definition: controllers.py:55
arbotix_python.controllers.Controller.device
device
Definition: controllers.py:41
arbotix_python.controllers.Controller.fake
fake
Definition: controllers.py:42
arbotix_python.controllers.Controller.getDiagnostics
def getDiagnostics(self)
Get a diagnostics message for this joint.
Definition: controllers.py:69
arbotix_python.controllers.Controller.shutdown
def shutdown(self)
Stop the controller, do any hardware shutdown needed.
Definition: controllers.py:59
arbotix_python.controllers.Controller.name
name
Definition: controllers.py:40
arbotix_python.controllers.Controller.startup
def startup(self)
Start the controller, do any hardware setup needed.
Definition: controllers.py:51
arbotix_python.controllers.Controller.joint_velocities
joint_velocities
Definition: controllers.py:48
arbotix_python.controllers.Controller.pause
pause
Definition: controllers.py:43
arbotix_python.controllers.Controller
Controllers interact with ArbotiX hardware.
Definition: controllers.py:32
arbotix_python.controllers.Controller.joint_positions
joint_positions
Definition: controllers.py:47
arbotix_python.controllers.Controller.__init__
def __init__(self, device, name)
Constructs a Controller instance.
Definition: controllers.py:39
arbotix_python.controllers.Controller.active
def active(self)
Is the controller actively sending commands to joints?
Definition: controllers.py:63


arbotix_python
Author(s): Michael Ferguson
autogenerated on Tue Mar 1 2022 23:48:25