Skip to content

Commit

Permalink
Test with Gazebo
Browse files Browse the repository at this point in the history
  • Loading branch information
708yamaguchi committed Jan 3, 2021
1 parent 17f89bd commit c633295
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 7 deletions.
6 changes: 3 additions & 3 deletions jsk_kinova_robot/kinovaeus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if(CATKIN_ENABLE_TESTING)
# Test with Kinematic Simulator
add_rostest(test/test-gen3.test)
add_rostest(test/test-gen3-lite.test)
# TODO: Test with Gazebo
# add_rostest(test/test-gen3-gazebo.test)
# add_rostest(test/test-gen3-lite-gazebo.test)
# Test with Gazebo and MoveIt!
add_rostest(test/test-gen3-moveit.test)
add_rostest(test/test-gen3-lite-moveit.test)
endif()
31 changes: 31 additions & 0 deletions jsk_kinova_robot/kinovaeus/test/test-gen3-lite-moveit.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env roseus
(require :unittest "lib/llib/unittest.l")
(require "package://kinovaeus/gen3-lite-utils.l")
(require "package://kinovaeus/gen3-lite-interface.l")

(init-unit-test)

(gen3-lite-init)

(deftest test-gen3-lite-move-moveit

(send *gen3-lite* :reset-pose)
(assert (send *ri* :angle-vector (send *gen3-lite* :angle-vector)))
(send *ri* :wait-interpolation)

(send *ri* :start-grasp :wait t)

(send *gen3-lite* :angle-vector #f(90.0 0.0 25.0 0.0 0.0 0.0 0.0))
(assert (send *ri* :angle-vector-raw (send *gen3-lite* :angle-vector)))
(send *ri* :wait-interpolation)

(send *gen3-lite* :arm :inverse-kinematics (make-coords :pos #f(300 0 200) :rpy (float-vector pi 0 pi)) :debug-view t)
(assert (send *ri* :angle-vector (send *gen3-lite* :angle-vector)))
(send *ri* :wait-interpolation)

(send *ri* :stop-grasp :wait t)
)


(run-all-tests)
(exit)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<arg name="gripper" value="gen3_lite_2f" />
<arg name="gazebo_gui" value="false" />
<arg name="start_rviz" value="false" />
<!-- TODO: Wait for https://github.com/Kinovarobotics/ros_kortex/pull/141 -->
<arg name="enable_test" value="false" />
</include>

<test pkg="kinovaeus" type="test-gen3-lite.l" test-name="gen3_lite_lisp" time-limit="300" />
<test pkg="kinovaeus" type="test-gen3-lite-moveit.l" test-name="gen3_lite_move_moveit"
time-limit="300" retry="2" />
</launch>
2 changes: 1 addition & 1 deletion jsk_kinova_robot/kinovaeus/test/test-gen3-lite.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<launch>
<test pkg="kinovaeus" type="test-gen3-lite.l" test-name="gen3_lite_lisp" time-limit="300" />
<test pkg="kinovaeus" type="test-gen3-lite.l" test-name="gen3_lite_move" time-limit="100" />
</launch>
31 changes: 31 additions & 0 deletions jsk_kinova_robot/kinovaeus/test/test-gen3-moveit.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env roseus
(require :unittest "lib/llib/unittest.l")
(require "package://kinovaeus/gen3-utils.l")
(require "package://kinovaeus/gen3-interface.l")

(init-unit-test)

(gen3-init)

(deftest test-gen3-move-moveit

(send *gen3* :reset-pose)
(assert (send *ri* :angle-vector (send *gen3* :angle-vector)))
(send *ri* :wait-interpolation)

(send *ri* :start-grasp :wait t)

(send *gen3* :angle-vector #f(90.0 0.0 25.0 0.0 0.0 0.0 0.0))
(assert (send *ri* :angle-vector-raw (send *gen3* :angle-vector)))
(send *ri* :wait-interpolation)

(send *gen3* :arm :inverse-kinematics (make-coords :pos #f(300 0 200) :rpy (float-vector pi 0 pi)) :debug-view t)
(assert (send *ri* :angle-vector (send *gen3* :angle-vector)))
(send *ri* :wait-interpolation)

(send *ri* :stop-grasp :wait t)
)


(run-all-tests)
(exit)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<arg name="gripper" value="robotiq_2f_85" />
<arg name="gazebo_gui" value="false" />
<arg name="start_rviz" value="false" />
<!-- TODO: Wait for https://github.com/Kinovarobotics/ros_kortex/pull/141 -->
<arg name="enable_test" value="false" />
</include>

<test pkg="kinovaeus" type="test-gen3.l" test-name="gen3_lisp" time-limit="300" />
<test pkg="kinovaeus" type="test-gen3-moveit.l" test-name="gen3_move_moveit"
time-limit="300" retry="2" />
</launch>
2 changes: 1 addition & 1 deletion jsk_kinova_robot/kinovaeus/test/test-gen3.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<launch>
<test pkg="kinovaeus" type="test-gen3.l" test-name="gen3_lisp" time-limit="300" />
<test pkg="kinovaeus" type="test-gen3.l" test-name="gen3_move" time-limit="100" />
</launch>

0 comments on commit c633295

Please sign in to comment.