Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][hrpsys_ros_bridge_tutorials] Enable to call :def-limb-controller-method before *ri* initialization #1095

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion hrpsys_ros_bridge/euslisp/rtm-ros-robot-interface.l
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
(cons :controller-action ,(format nil "~A_controller/follow_joint_trajectory_action" (string-downcase limb)))
(cons :controller-state ,(format nil "~A_controller/state" (string-downcase limb)))
(cons :action-type control_msgs::FollowJointTrajectoryAction)
(cons :joint-names (list ,@(send-all (send robot limb :joint-list) :name))))
(cons :joint-names (send-all (send robot ,limb :joint-list) :name)))
)))))
(if debugp
(pprint (macroexpand sexp)))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(require :unittest "lib/llib/unittest.l")
(load "package://hrpsys_ros_bridge/euslisp/samplerobot-interface.l")

(init-unit-test)

;; Wait until Ros bridges are prepared.
(ros::roseus "unittest")
(unless (boundp '*tfl*)
(defvar *tfl* (instance ros::transform-listener :init)))
(send *tfl* :wait-for-transform "WAIST_LINK0" "odom" (ros::time) 20.0)

(deftest test-def-limb-controller-method
;; Test :def-limb-controller-method before *ri* initialization
(assert (instance samplerobot-interface :def-limb-controller-method :rleg))
(samplerobot-init)
;; Test :def-limb-controller-method after *ri* initialization
(assert (send *ri* :def-limb-controller-method :rleg))
)

(run-all-tests)
(exit)
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@
args="$(find hrpsys_ros_bridge)/test/hrpsys-samples/samplerobot-unittest.l $(find hrpsys_ros_bridge)/test/hrpsys-samples/samplerobot-auto-balancer.l"
time-limit="900"
retry="1" />
<test test-name="test_def_limb_controller_method" pkg="roseus" type="roseus"
args="$(find hrpsys_ros_bridge)/test/hrpsys-samples/test-def-limb-controller-method.l"
time-limit="300"
retry="1" />
</launch>