Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions hlpr_gazebo/scripts/body_part_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ def send_cmd_msg(self):


def run(self):
while self.joint_names is None:
print "Waiting for joint state information from %s/state topic" %self.controller
rospy.sleep(2)
print "Received joint state information. Sending %s to default position (rads)" % self.controller
print self.position
while self.joint_names is None and not rospy.is_shutdown():
rospy.loginfo_throttle(5, "Waiting for joint state information from %s/state topic" %self.controller)
rospy.sleep(0.1)
rospy.loginfo("Received joint state information. Sending %s to default position (rads)" % self.controller + str(self.position))

cmd_msg = self.send_cmd_msg()
self.goal_pub.publish(cmd_msg)
Expand All @@ -68,4 +67,9 @@ def run(self):


JTT = JointTrajectorySetup(controller=controller, position=position)
JTT.run()
try:
JTT.run()
except rospy.exceptions.ROSInterruptException as e:
rospy.loginfo("JTT for " + controller + "was interrupted before receiving joint information")
else:
pass