Skip to content

Commit

Permalink
[UNTESTED] + Stepper
Browse files Browse the repository at this point in the history
  • Loading branch information
ymollard committed Nov 6, 2020
1 parent 6c547b8 commit f0d12ec
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions luos_interface/luos_interface/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .servo_motor import LuosServoMotorPublisher
from .voltage import LuosVoltagePublisher
from .dxl import LuosDxlMotorPublisher
from .stepper import LuosStepperMotorPublisher

_make = {
'State': LuosStatePublisher,
Expand All @@ -24,6 +25,7 @@
'Servo': LuosServoMotorPublisher,
'Voltage': LuosVoltagePublisher,
'DynamixelMotor': LuosDxlMotorPublisher,
'Stepper': LuosStepperMotorPublisher,
}

def make_module_interface_factory(node, module, rate):
Expand Down
56 changes: 56 additions & 0 deletions luos_interface/luos_interface/modules/stepper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from std_msgs.msg import Float32, Bool
from .serializers import serializeFloat32, serializeFloat32DegToRad, serializeBool
from .deserializers import deserializeFloat32, deserializeFloat32RadToDeg, deserializeBool
from .generic import LuosGenericPublisher

class LuosStepperMotorPublisher(LuosGenericPublisher):
def __init__(self, node, module, rate):
variables = {
"compliant": {
"read_type": Bool, "write_type": Bool,
"serialize": serializeBool, "deserialize": deserializeBool,
},
"rot_position_mode": {
"read_type": Bool, "write_type": Bool,
"serialize": serializeBool, "deserialize": deserializeBool,
},
"rot_speed_mode": {
"read_type": Bool, "write_type": Bool,
"serialize": serializeBool, "deserialize": deserializeBool,
},
"trans_position_mode": {
"read_type": Bool, "write_type": Bool,
"serialize": serializeBool, "deserialize": deserializeBool,
},
"trans_speed_mode": {
"read_type": Bool, "write_type": Bool,
"serialize": serializeBool, "deserialize": deserializeBool,
},
"stepPerTurn": {
"read_type": Float32, "write_type": Float32,
"serialize": serializeFloat32, "deserialize": deserializeFloat32,
},
"wheel_size": {
"read_type": Float32, "write_type": Float32,
"serialize": serializeFloat32, "deserialize": deserializeFloat32,
},
"target_rot_position": {
"read_type": Float32, "write_type": Float32,
"serialize": serializeFloat32, "deserialize": deserializeFloat32,
},
"target_rot_speed": {
"read_type": Float32, "write_type": Float32,
"serialize": serializeFloat32, "deserialize": deserializeFloat32,
},
"target_trans_position": {
"read_type": Float32, "write_type": Float32,
"serialize": serializeFloat32, "deserialize": deserializeFloat32,
},
"target_trans_speed": {
"read_type": Float32, "write_type": Float32,
"serialize": serializeFloat32, "deserialize": deserializeFloat32,
},
}
events = {}
aggregates = {}
super(LuosStepperMotorPublisher, self).__init__(node, module, rate, variables, events, aggregates)

0 comments on commit f0d12ec

Please sign in to comment.