def __init__(self, hyperparams):
config = copy.deepcopy(agent_superball)
config.update(hyperparams)
Agent.__init__(self, config)
self._sensor_types = set(self.x_data_types + self.obs_data_types)
self.x0 = None
self._sensor_readings = {}
self._prev_sensor_readings = {}
self._prev2_sensor_readings = {}
if self._hyperparams['constraint']:
import superball_kinematic_tool as skt
self._constraint = skt.KinematicMotorConstraints(
self._hyperparams['constraint_file'], **self._hyperparams['constraint_params']
)
rospy.init_node('superball_agent', disable_signals=True, log_level=rospy.DEBUG)
self._state_update = False
self._state_update_cv = threading.Condition()
if 'state_estimator' in self._hyperparams and self._hyperparams['state_estimator']:
self._state_sub = rospy.Subscriber(
'/superball/state', SUPERballStateArray,
callback=self._handle_state_msg, queue_size=1
)
else:
self._state_sub = rospy.Subscriber(
'/superball/state_sim', SUPERballStateArray,
callback=self._handle_state_msg, queue_size=1
)
self._ctrl_pub = rospy.Publisher('/superball/control', String, queue_size=1)
self._timestep_pub = rospy.Publisher('/superball/timestep', UInt16, queue_size=1)
self._init_motor_pubs()
self._compute_rel_pos = True
self.reset(0)
agent_superball.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录