How to install:
- install ROS noetic or melodic
- sudo apt get install ros-noetic-roseus or ros-melodic-roseus
- sudo reboot
- cd kxreus
- make libs ;; setup usb drivers
- make
- make gen ;; generate typical robot models into kxreus/models directory
- connect USB dual adapter to PC
- lsusb ;; to show names of USB devices. check the name Kondo Kagaku...
How to use:
- cd kxreus
- roseus semi2024
- (semi-init) ;; demo program new UI setup
- Drag the green viewer of robot kxrl2l2a6h2m to show. ;; check new mouse operation(:new-ui to irtviewer) ;; left-button: changes view angle. ;; Shift + left-button: slide view ;; Ctrl + left-button: scale view
- (pf semi-init)
- (send robot :walk-motion :x 200 :y 200 :angle 10) ;; walk forward ported from irteus/demo/walk-motion.l
- (load "kxranimate.l")
- (objects-kxr-robots) ;; show typical robot models in a viewer.
How to move real robot ex. kxrl2g:
- connect USB dual adapter with serial LED from PC to a robot
- roseus semi2024
- (make-kxr-robot "kxrl2g") ;; generates robot, ri, two viewers ;; other robots "kxrl4t", "kxrl4d", "kxrl6" etc. in kxreus/models ;; green viewer for robot, purple viewer for ri
- (send ri :timer-on) ;; call :com-init, and start itimer to update ri viewer
- (send ri :free :larm :rarm :head) ;; servo off uppder body joints ;; you can move upper body of kxrl2g. ;; (send ri :free) to servo off all the joints
- (setq a (send ri :read-angle-vector)) ;; store current pose to variable a
- (send ri :hold) ;; servo on all joints
- (send ri :angle-vector a 2000) ;; move to a posture in 2000[msec]
- (send ri :call-motion 22) ;; call No. 22 motion in 0-119 motion table in ROM
- (send ri :timer-off) ;; stop continuous viewer update
- (send ri :draw-project-file) ;; show animation of motion-table
- (reset) ;; when get error in roseus
- Ctrl-C ;; in case hang up in :timer-on continuous viewer update
- (exit) ;; exit from roseus
;; details are in kxr-document.txt
;; Rubik cube demo https://www.youtube.com/watch?v=CVYYmKJGDNQ described in https://github.com/fkanehiro/kxr_cube_solver the robot is named kxrl2l2a6h2m in rcb4robotconfig.l It has 2 2DOF legs, 6DOF arm, 2DOF head, magnet modular robot.
Robot-model generation: No requirements of real robot connections.
-
roseus semi2024
-
(make-kxr-robot "kxrl2l6a6h2m" :generate t) ;; when already models/kxrl2l6a6h2m.l exists, :generate key generates again.
-
(make-kxr-robot "kxrkamakiri") ;; when no models/kxrkamakiri.l, generates it.
-
(make-kxr-robot "kxrkamakiri" :model nil) ;; generates robot as an instance of kxr-robot model not models/kxrkamakiri.l ;; that is an instance of euscollada-robot model
;; you can find the robot config of kxr-robot models in a global variable ;; kxr-body-config-alist in rcb4robotconfig.l. ;; Each config has robot-name, model-param, servo-id and joint-name params. ;; You can specify a robot name in this alist to generate model. ;; model-param specifications are :setup-xxxx arguments in kxrmodels.l. ;; When you want to generate new robot, you define it with a body ;; in kxrbody.l, a bodyset in kxrbodyset.l, a robot-link in kxrlinks.l, ;; extends the definition of :setup-xxxx in kxreus.
Other robot model generation software: https://github.com/agent-system/robot_assembler
Rcb4lisp sample: Connect real kxrl2g robot to PC.
- roseus semi2024.l
- (make-kxr-robot "kxrl2g")
- (send ri :com-init)
- (semi-comp-jswing) ;; define comp-jswing for :head-neck-y swing motion
- (comp-jswing) ;; execute comp-jswing :head-neck-y joint swing
- (semi-comp-remocon) ;; define a motion for a robot with 2DOF neck joints
- (comp-remocon) ;; execute the motion defined by semi-comp-remocon ;; remocon <shift-3 (:r-shift-u)> button for :head-neck-y joint ;; remocon <shift-1 (:l-shift-u)> button for :head-neck-p joint ;; remocon button to exit from comp-remocon motion
- (semi-comp-squat) ;; for kxrl2g with 5DOF leg example defined
- (comp-squat) ;; execute comp-squat motion defined by semi-comp-squat ;; remocon button to execute squat motion ;; remocon button to exit this motion loop
- (semi-comp-iksquat) ;; for kxrl2g inverse-kinematics squat motion
- (comp-iksquat) ;; execute the IK squat motion defined by semi-comp-iksquat ;; remocon button to execute squat motion ;; remocon button to exit this motion loop
Roseus basics: Roseus is an extention of a subset of CommonLisp: Euslisp https://github.com/euslisp/euslisp. UTokyo JSK provides extentions jskeus https://github.com/euslisp/jskeus with robot programming, and roseus with ROS extentions. https://github.com/jsk-ros-pkg/jsk_roseus euslisp < jskeus < roseus. see slide for euslisp: https://www.slideshare.net/slideshow/euslisp/53487698
- roseus
- (load "irteus/demo/demo.l") ;; show sample programs
- (particle) ;; interval timer sample used in :timer-on
- (hand-grasp) ;; Object distances with :inverse-kinematics-loop
- (hanoi-arm) ;; Hanoi tower task :inverse-kinematics
- (dual-arm-ik) ;; Bloom manipulation with :inverse-kinematics
- (crank-motion) ;; Humanoid crank rotation with :fullbody-inverse-kinematics
- (head-look-at-ik) ;; Humanoid head motion with :fullbody-inverse-kinematics
- (walk-motion-for-sample-robot) ;; walk motion sample robot
- (walk-motion-for-robots) ;; walk motion for H7, H6, Kaz3, Darwin