Commit 74bc5725 authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[Script] add talos/hrp2 template scripts

parent 4ae0a4c7
from .abstract_contact_generator import AbstractContactGenerator
import time
class HRP2ContactGenerator(AbstractContactGenerator):
def __init__(self, path_planner):
super().__init__(path_planner)
self.robustness = 1
def load_fullbody(self):
from hpp.corbaserver.rbprm.hrp2 import Robot
self.fullbody = Robot()
self.q_ref = self.fullbody.referenceConfig[::] + [0] * self.path_planner.extra_dof
self.weight_postural = self.fullbody.postureWeights[::] + [0] * self.path_planner.extra_dof
def set_joints_bounds(self):
super().set_joints_bounds()
# increase min bounds on knee, required to stay in the 'comfort zone' of the stabilizer
self.fullbody.setJointBounds("LLEG_JOINT3", [0.4, 2.61799])
self.fullbody.setJointBounds("RLEG_JOINT3", [0.4, 2.61799])
def init_viewer(self):
super().init_viewer()
self.v.addLandmark('hrp2_14/base_link',0.3)
from .abstract_path_planner import AbstractPathPlanner
class HRP2PathPlanner(AbstractPathPlanner):
def __init__(self):
super().__init__()
# set default bounds to a large workspace on x,y with small interval around reference z value
self.root_translation_bounds = [-5., 5., -5., 5., 0.5, 0.8]
# set default used limbs to be both feet
self.used_limbs = ['hrp2_rleg_rom','hrp2_lleg_rom']
self.size_foot_x = 0.18 # size of the feet along the x axis
self.size_foot_y = 0.1 # size of the feet along the y axis
self.v_max = 0.2
self.a_max = 0.1
self.extra_dof_bounds = [-self.v_max, self.v_max, -self.v_max, self.v_max, 0, 0,
-self.a_max, self.a_max, -self.a_max, self.a_max, 0, 0]
def load_rbprm(self):
from hpp.corbaserver.rbprm.hrp2_abstract import Robot
self.rbprmBuilder = Robot()
self.rbprmBuilder.client.robot.setDimensionExtraConfigSpace(self.extra_dof)
self.q_init = self.rbprmBuilder.getCurrentConfig()
self.q_goal = self.rbprmBuilder.getCurrentConfig()
self.q_init[2] = self.rbprmBuilder.ref_height
self.q_goal[2] = self.rbprmBuilder.ref_height
from .abstract_contact_generator import AbstractContactGenerator
import time
class TalosContactGenerator(AbstractContactGenerator):
def __init__(self, path_planner):
super().__init__(path_planner)
self.robustness = 2
def load_fullbody(self):
from talos_rbprm.talos import Robot
self.fullbody = Robot()
self.q_ref = self.fullbody.referenceConfig[::] + [0] * self.path_planner.extra_dof
self.weight_postural = self.fullbody.postureWeights[::] + [0] * self.path_planner.extra_dof
def init_viewer(self):
super().init_viewer()
self.v.addLandmark('talos/base_link', 0.3)
from .abstract_path_planner import AbstractPathPlanner
class TalosPathPlanner(AbstractPathPlanner):
def __init__(self):
super().__init__()
# set default bounds to a large workspace on x,y with small interval around reference z value
self.root_translation_bounds = [-5., 5., -5., 5., 0.95, 1.05]
# set default used limbs to be both feet
self.used_limbs = ['talos_lleg_rom','talos_rleg_rom']
self.size_foot_x = 0.2 # size of the feet along the x axis
self.size_foot_y = 0.12 # size of the feet along the y axis
self.v_max = 0.3
self.a_max = 0.1
self.extra_dof_bounds = [-self.v_max, self.v_max, -self.v_max, self.v_max, 0, 0,
-self.a_max, self.a_max, -self.a_max, self.a_max, 0, 0]
def load_rbprm(self):
from talos_rbprm.talos_abstract import Robot
self.rbprmBuilder = Robot()
def set_joints_bounds(self):
super().set_joints_bounds()
self.rbprmBuilder.setJointBounds('torso_1_joint', [0, 0])
self.rbprmBuilder.setJointBounds('torso_2_joint', [0.006761, 0.006761])
def set_configurations(self):
super().set_configurations()
self.q_init[8] = 0.006761
self.q_goal[8] = 0.006761
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment