def set_start(self, obsy, sigmay=1e-6):
if isinstance(obsy, RobotState):
obsy = obsy.joint_state
elif not isinstance(obsy, JointState):
raise TypeError("ros.ProMP.set_start only accepts RS or JS, got {}".format(type(obsy)))
try:
positions = [obsy.position[obsy.name.index(joint)] for joint in self.joint_names] # Make sure joints are in right order
except KeyError as e:
raise KeyError("Joint {} provided as start state is unknown to the demonstrations".format(e))
else:
self.promp.set_start(map(float, positions), sigmay)
评论列表
文章目录