Skip to content

Commit

Permalink
Merge pull request #322 from YoheiKakiuchi/fix_param
Browse files Browse the repository at this point in the history
[choreonoid_hrpsys_config.py] add parameter for setting name of RobotHardware
  • Loading branch information
YoheiKakiuchi authored Mar 18, 2020
2 parents aa262ec + b45b7c5 commit 63c49f0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def parse_arg_for_connect_ports (self, arg_list):
return [arg_list, False]

class ChoreonoidHrpsysConfigurator(ChoreonoidHrpsysConfiguratorOrg):
def __init__(self, robotname="", hardware_name="RobotHardware_choreonoid0"):
self.ROBOT_HW_NAME = hardware_name
URATAHrpsysConfigurator.__init__(self,robotname=robotname)

def waitForRobotHardware(self, robotname="Robot"):
'''!@brief
Wait for RobotHardware is exists and activated.
Expand All @@ -68,7 +72,7 @@ def waitForRobotHardware(self, robotname="Robot"):
while self.rh == None and timeout_count < 10: # <- time out limit
if timeout_count > 0: # do not sleep initial loop
time.sleep(1);
self.rh = rtm.findRTC("RobotHardware_choreonoid0")
self.rh = rtm.findRTC(self.ROBOT_HW_NAME)
print(self.configurator_name + "wait for %s : %s ( timeout %d < 10)" % ( robotname, self.rh, timeout_count))
if self.rh and self.rh.isActive() == None: # just in case rh is not ready...
self.rh = None
Expand Down

0 comments on commit 63c49f0

Please sign in to comment.