34 """ Definition of an abstract base class for device teleoperation. """
38 from abc
import ABC, abstractmethod
40 from rclpy.node
import Node
43 from geometry_msgs.msg
import TwistStamped
44 from sensor_msgs.msg
import Joy
45 from std_srvs.srv
import Trigger
50 An abstract base class for a teleoperation device.
52 This class expects both the `publish_command` and `record` methods to be overridden by inheriting classes.
55 def __init__(self, node_name, device_name, device_config, ee_frame_name):
56 super().
__init__(node_name=node_name)
66 TwistStamped,
"/servo_node/delta_twist_cmds", 10
69 Trigger,
"/servo_node/start_servo"
72 Trigger,
"/servo_node/stop_servo"
79 Starts servo client and teleop process.
88 ex = rclpy.executors.MultiThreadedExecutor()
90 self.
teleop_threadteleop_thread = threading.Thread(target=ex.spin, daemon=
True)
92 except Exception
as e:
97 Stops servo client and teleop process.
103 except Exception
as e:
109 Publishes the teleop command.
116 Records trajectory data.
def publish_command(self)
def __init__(self, node_name, device_name, device_config, ee_frame_name)
void print(PropagationDistanceField &pdf, int numX, int numY, int numZ)