-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for :go-pos and :go-pos-unsafe
- Loading branch information
1 parent
3682766
commit 632b506
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<launch> | ||
<include file="$(find jsk_fetch_gazebo_demo)/launch/demo.launch" > | ||
<arg name="run_demo_script" value="false" /> | ||
<arg name="rviz" value="false" /> | ||
</include> | ||
|
||
<test test-name="demo_test" pkg="roseus" type="roseus" name="demo_test" args="$(find jsk_fetch_gazebo_demo)/test/test-go-pos.l" time-limit="600"/> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env roseus | ||
|
||
(require :unittest "lib/llib/unittest.l") | ||
(init-unit-test) | ||
|
||
(load "package://fetcheus/fetch-interface.l") | ||
(fetch-init) | ||
|
||
(deftest test-go-pos () | ||
(let ((diff #f(1000 0 0)) pos-now pos-goal) | ||
(setq pos-now (send (send *ri* :state :worldcoords "map") :worldpos)) | ||
(setq pos-goal (v+ pos-now diff)) | ||
(ros::ros-warn " goal position: ~A (diff:~A)" pos-goal (norm diff)) | ||
;; go-pos | ||
(send *ri* :go-pos (/ (elt diff 0) 1000.0) (/ (elt diff 1) 1000.0) 0) | ||
(setq pos-now (send (send *ri* :state :worldcoords "map") :worldpos)) | ||
(ros::ros-warn " goal position: ~A (diff:~A)" pos-goal (norm (v- pos-goal pos-now))) | ||
(assert (< (norm (v- pos-goal pos-now)) 500) | ||
(format nil "go-pos moves incorrectly : ~A" (norm (v- pos-goal pos-now)))) | ||
)) | ||
|
||
(deftest test-go-pos-unsafe | ||
(let ((diff #f(1000 0 0)) pos-now pos-goal) | ||
(setq pos-now (send (send *ri* :state :worldcoords "map") :worldpos)) | ||
(setq pos-goal (v+ pos-now diff)) | ||
(ros::ros-warn " goal position: ~A (diff:~A)" pos-goal (norm diff)) | ||
;; go-pos-unsafe | ||
(send *ri* :go-pos-unsafe (/ (elt diff 0) 1000.0) (/ (elt diff 1) 1000.0) 0) | ||
(setq pos-now (send (send *ri* :state :worldcoords "map") :worldpos)) | ||
(ros::ros-warn " goal position: ~A (diff:~A)" pos-goal (norm (v- pos-goal pos-now))) | ||
(assert (< (norm (v- pos-goal pos-now)) 500) | ||
(format nil "go-pos moves incorrectly : ~A" (norm (v- pos-goal pos-now)))) | ||
)) | ||
|
||
(run-all-tests) | ||
(exit) |