Conversation
schromya
left a comment
There was a problem hiding this comment.
The latch parameter works amazingly! Thanks for solving that! Just left a few small comments, mainly just to improve readability.
| @@ -0,0 +1,44 @@ | |||
| """ | |||
| This currently does NOT work. | |||
There was a problem hiding this comment.
Please update this comment :)
| # send at least 2. | ||
| N = 1 | ||
| print("************** N =", N) | ||
| for i in range(N): |
There was a problem hiding this comment.
Do you mind removing the loop for readability?
| for i in range(N): | ||
| # default RESET angle [0., -0.34, 0., -1.66, 0., 1.32, 0.8] | ||
|
|
||
| test_pose = [0., -0.3, 0., -1.66, 0., 1.32, 0.8] |
There was a problem hiding this comment.
Is there a reason there is 2 of these?
| @@ -0,0 +1,56 @@ | |||
| """ | |||
| This currently does NOT work. | |||
There was a problem hiding this comment.
Please update this comment :)
|
|
||
|
|
||
| def test_reset(): | ||
| pub = rospy.Publisher('/parser/command', Command, queue_size=1) |
There was a problem hiding this comment.
This currently doesn't move the bot since it doesn't have the latch parameter.
|
|
||
| # For some reason, a single message does not go through so need to | ||
| # send at least 2. | ||
| for i in range(1): |
There was a problem hiding this comment.
Could you remove the loop for readability?
| poses.poses = [p0 ] # Home position | ||
|
|
||
| action = Action(type=Action.RESET, # RESET | ||
| poses=poses, |
There was a problem hiding this comment.
This command doesn't need any poses so I would just remove this and lines 20-35.
Add test_move_angle.py
Add test_reset.py
Solve "publish at least twice" problem in test_move_angle.py by adding
latch=Trueoption in published in test_move_angle.pyExplain:
I use
rostopic echo /parser/commandto monitor what is being published in our test file and find that if publish once, nothing is published. So the problem comes from command publisher in our test file. The latch option will make sure publishing successfully.From ROS wiki: