klampt.control.interop module

Defines utilities for connecting simulation controllers to the Robot Interface Layer, and connect ControllerBlocks to RobotInterfaceBase receivers.

Classes:

RobotControllerToInterface(controller, …)

A class that connects the I/O of a standard ControllerBlock robot controller with a RobotInterfaceBase Robot Interface Layer API.

RobotInterfacetoVis(robotInterface[, …])

A class that manages connections between the sensor readings of a RobotInterfaceBase Robot Interface Layer API to the Klamp’t vis module.

SimRobotControllerToInterface(robotInterface)

A class that provides an API like SimRobotController so that simulation control code can be ported easily to a RobotInterfaceBase Robot Interface Layer API.

class klampt.control.interop.RobotControllerToInterface(controller, robotInterface, controllerRateRatio=1)[source]

Bases: object

A class that connects the I/O of a standard ControllerBlock robot controller with a RobotInterfaceBase Robot Interface Layer API.

Parameters
  • controller (ControllerBlock) – the controller software, should conform to the RobotControllerBase convention.

  • robotInterface (RobotInterfaceBase) – the robot interface

  • controllerRateRatio (float, optional) – if not 1, scales how many times the controller is run for each main loop of the robotInterface

Methods:

advance()

advance()[source]
class klampt.control.interop.RobotInterfacetoVis(robotInterface, visRobotIndex=0)[source]

Bases: object

A class that manages connections between the sensor readings of a RobotInterfaceBase Robot Interface Layer API to the Klamp’t vis module.

This assumes that vis has been set up with an appropriate world.

Methods:

update()

update()[source]
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 a RobotInterfaceBase 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:

addCubic(q, dt)

addLinear(q, dt)

addMilestone(q[, dq])

addMilestoneLinear(q)

commands()

endStep()

getCommandedConfig()

getCommandedTorque()

getCommandedVelocity()

getControlType()

getPIDGains()

getRate()

getSensedConfig()

getSensedTorque()

getSensedVelocity()

getSetting(name)

initialize()

model()

remainingTime()

sendCommand(name, args)

sensor(index_or_name)

setCubic(q, v, dt)

setLinear(q, dt)

setManualMode(enabled)

setMilestone(q[, dq])

setPIDCommand(qdes, dqdes[, tfeedforward])

setPIDGains(kP, kI, kD)

setRate(dt)

setSetting(name, val)

setTorque(t)

setVelocity(dq, dt)

startStep()

addCubic(q, dt)[source]
addLinear(q, dt)[source]
addMilestone(q, dq=None)[source]
addMilestoneLinear(q)[source]
commands()[source]
endStep()[source]
getCommandedConfig()[source]
getCommandedTorque()[source]
getCommandedVelocity()[source]
getControlType()[source]
getPIDGains()[source]
getRate()[source]
getSensedConfig()[source]
getSensedTorque()[source]
getSensedVelocity()[source]
getSetting(name)[source]
initialize()[source]
model()[source]
remainingTime()[source]
sendCommand(name, args)[source]
sensor(index_or_name)[source]
setCubic(q, v, dt)[source]
setLinear(q, dt)[source]
setManualMode(enabled)[source]
setMilestone(q, dq=None)[source]
setPIDCommand(qdes, dqdes, tfeedforward=None)[source]
setPIDGains(kP, kI, kD)[source]
setRate(dt)[source]
setSetting(name, val)[source]
setTorque(t)[source]
setVelocity(dq, dt)[source]
startStep()[source]