klampt.control.interop module
Defines utilities for connecting simulation controllers to the Robot Interface Layer, and connect ControllerBlocks to RobotInterfaceBase receivers.
Classes:
|
A class that provides an API like |
|
A class that connects the I/O of a |
|
A class that produces a standard klampt.vis display to monitor a |
- class klampt.control.interop.SimRobotControllerToInterface(robotInterface)[source]
Bases:
object
A class that provides an API like
SimRobotController
so that simulation control code can be ported easily to aRobotInterfaceBase
Robot Interface Layer API.Missing:
setRate(dt): can’t change a real robot’s control rate.
getSetting()/setSetting(): no interface to configure robot.
setMilestone(q,dq): can’t set a terminal velocity.
add*(): can’t queue up commands.
getPIDGains(): can’t configure PID gains.
- Parameters:
robotInterface (RobotInterfaceBase) – the robot interface to use
Methods:
endStep
()model
()setRate
(dt)getRate
()sensor
(index_or_name)commands
()sendCommand
(name, args)getSetting
(name)setSetting
(name, val)setMilestone
(q[, dq])addMilestone
(q[, dq])setLinear
(q, dt)setCubic
(q, v, dt)addLinear
(q, dt)addCubic
(q, dt)setVelocity
(dq, dt)setTorque
(t)setPIDCommand
(qdes, dqdes[, tfeedforward])setManualMode
(enabled)setPIDGains
(kP, kI, kD)
- class klampt.control.interop.RobotControllerBlockToInterface(controller, robotInterface, controllerRateRatio=1)[source]
Bases:
object
A class that connects the I/O of a
RobotControllerBlock
robot controller with aRobotInterfaceBase
Robot Interface Layer API.- Parameters:
controller (RobotControllerBlock) – the controller block.
robotInterface (RobotInterfaceBase) – the robot interface
controllerRateRatio (float, optional) – if not 1, scales how many times the block is run for each main loop of the robotInterface
Methods:
advance
([step_interface])Moves forward the controller and interface one step.
- advance(step_interface=False)[source]
Moves forward the controller and interface one step.
If step_interface = True the robotInterface will also be stepped. Otherwise, make sure you call startStep()/endStep() like:
c2i = RobotControllerBlockToInterface(...) c2i.robotInterface.startStep() c2i.advance() c2i.robotInterface.endStep()
- class klampt.control.interop.RobotInterfacetoVis(robotInterface, visRobotIndex=0)[source]
Bases:
object
A class that produces a standard klampt.vis display to monitor a
RobotInterfaceBase
Robot Interface Layer API.Note: this assumes that
vis
has been set up with an appropriate world.Methods:
update
()