Permalink
Browse files

Expand queue size for solve test failure

  • Loading branch information...
7675t committed Jul 10, 2018
1 parent 49c084e commit 3b94d3a2f3f4a00cf160f9cf2a76d359cf71766e
Showing with 13 additions and 9 deletions.
  1. +13 −9 jog_controller/test/test_jog_joint.py
@@ -35,7 +35,7 @@ def setUp(self):
self.joint_state_ = rospy.wait_for_message('joint_states', JointState, timeout=10.0)
rospy.Subscriber('joint_states', JointState, self.cb_joint_states, queue_size=10)
# Publishers
self.pub = rospy.Publisher('jog_joint', JogJoint, queue_size=10)
self.pub = rospy.Publisher('jog_joint', JogJoint, queue_size=50)
# Actionlib
self.client = actionlib.SimpleActionClient(
self.controller_name + '/' + self.action_name, FollowJointTrajectoryAction)
@@ -59,7 +59,7 @@ def move_to_home(self):
def cb_joint_states(self, msg):
self.joint_state_ = msg
def test_one_jog_for_all_joint(self):
'''Test to jog a jog command'''
joint_state = self.joint_state_
@@ -68,7 +68,7 @@ def test_one_jog_for_all_joint(self):
jog.joint_names = self.joint_names
jog.deltas = [self.delta]*len(jog.joint_names)
self.pub.publish(jog)
rospy.sleep(0.5)
rospy.sleep(1.0)
# Check if the robot is jogged by delta
for joint in self.joint_names:
index = joint_state.name.index(joint)
@@ -84,7 +84,7 @@ def test_ten_jogs_for_all_joint(self):
jog.joint_names = self.joint_names
jog.deltas = [self.delta]*len(jog.joint_names)
self.pub.publish(jog)
rospy.sleep(0.5)
rospy.sleep(1.0)
# Check if the robot is jogged by 10*delta
for joint in self.joint_names:
index = joint_state.name.index(joint)
@@ -106,25 +106,29 @@ def test_loop_jogs_for_all_joint(self):
jog.joint_names = self.joint_names
jog.deltas = [-self.delta]*len(jog.joint_names)
self.pub.publish(jog)
rospy.sleep(0.5)
rospy.sleep(1.0)
# Check if the robot is not moved
for joint in self.joint_names:
index = joint_state.name.index(joint)
self.assertAlmostEqual(joint_state.position[index],
self.joint_state_.position[index], delta=0.0001)
self.assertAlmostEqual(
joint_state.position[index],
self.joint_state_.position[index],
delta=0.0001)
def test_empty_jog_for_all_joint(self):
'''Test to publish empty jonit_names/positions jog command'''
joint_state = self.joint_state_
jog = JogJoint()
jog.header.stamp = rospy.Time.now()
self.pub.publish(jog)
rospy.sleep(0.5)
rospy.sleep(1.0)
# Check if the robot is not moved
for joint in self.joint_names:
index = joint_state.name.index(joint)
self.assertAlmostEqual(
joint_state.position[index], self.joint_state_.position[index], delta=0.0001)
joint_state.position[index],
self.joint_state_.position[index],
delta=0.0001)
if __name__ == '__main__':
rostest.rosrun('jog_joint', 'test_jog_joint_node', TestJogJointNode)

0 comments on commit 3b94d3a

Please sign in to comment.