forked from start-jsk/rtmros_gazebo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request start-jsk#119 from snozawa/fix_hrpsys_sample_and_a…
…dd_unittest_euslisp
- Loading branch information
Showing
7 changed files
with
361 additions
and
182 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
32 changes: 22 additions & 10 deletions
32
hrpsys_ros_bridge_tutorials/test/hrpsys-samples/samplerobot-data-logger.l
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 |
---|---|---|
@@ -1,30 +1,42 @@ | ||
#!/usr/bin/env roseus | ||
|
||
;; $ rtmlaunch hrpsys_ros_bridge_tutorials samplerobot.launch | ||
;; $ roseus samplerobot-data-logger.l "(demo)" | ||
;; $ roseus samplerobot-data-logger.l "(samplerobot-data-logger-demo)" | ||
|
||
(load "package://hrpsys_ros_bridge_tutorials/euslisp/samplerobot-interface.l") | ||
|
||
(defun init () | ||
(defun samplerobot-data-logger-init () | ||
(samplerobot-init) | ||
) | ||
|
||
(defun demo () | ||
(init) | ||
t) | ||
|
||
;; 1. Set max ring-buffer length : 200 [loop] * 0.002 [s] = 0.4 [s] data | ||
(defun samplerobot-data-logger-demo0 () | ||
"1. Set max ring-buffer length : 200 [loop] * 0.002 [s] = 0.4 [s] data" | ||
(send *ri* :set-log-maxlength 200) | ||
(print "maxLength() =>OK") | ||
;; Clear buffer | ||
t) | ||
|
||
(defun samplerobot-data-logger-demo1 () | ||
"2. Clear buffer" | ||
(send *ri* :start-log) | ||
(print "clear() =>OK") | ||
t) | ||
|
||
(defun samplerobot-data-logger-demo2 () | ||
"3. Save log" | ||
(send *sr* :reset-pose) | ||
(send *ri* :angle-vector (send *sr* :angle-vector) 2000) | ||
(send *ri* :wait-interpolation) | ||
;; Save log files for each ports as /tmp/test-samplerobot-log.* | ||
;; file names are /tmp/test-samplerobot-log.[RTCName]_[PortName], c.f., /tmp/test-samplerobot-log.sh_qOut ... etc | ||
(send *ri* :save-log "/tmp/test-samplerobot-log") | ||
(print "save() =>OK") | ||
(find-if #'(lambda (x) (substringp "test-samplerobot-log" x)) (directory "/tmp")) | ||
) | ||
|
||
(defun samplerobot-data-logger-demo () | ||
(samplerobot-data-logger-init) | ||
(samplerobot-data-logger-demo0) | ||
(samplerobot-data-logger-demo1) | ||
(samplerobot-data-logger-demo2) | ||
) | ||
|
||
;;(demo) | ||
(warn ";; (samplerobot-data-logger-demo)~%") |
Oops, something went wrong.