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

New add euslisp test #799

Closed
wants to merge 4 commits into from
Closed
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
matrix:
- ROS_DISTRO=hydro USE_DEB=true
- ROS_DISTRO=hydro USE_DEB=false NOT_TEST_INSTALL=true
- ROS_DISTRO=hydro USE_DEB=false NOT_TEST_INSTALL=true EXTRA_DEB="ros-hydro-roseus ros-hydro-euscollada ros-hydro-pr2eus" CATKIN_PARALLEL_JOBS='-p1'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frequently ROS_DISTRO=hydro USE_DEB=false NOT_TEST_INSTALL=true EXTRA_DEB="ros-hydro-roseus ros-hydro-euscollada ros-hydro-pr2eus" fails because of compile error because of kill and memory shortage.

When I add CATKIN_PARALLEL_JOBS='-p1', travis seems to be OK.

- ROS_DISTRO=hydro USE_DEB=true NOT_TEST_INSTALL=true INSTALL_SRC="http://github.com/start-jsk/rtmros_tutorials" TEST_PKGS="hrpsys_ros_bridge_tutorials" INSTALL_SRC_SECURE="[email protected]:start-jsk/rtmros_hrp2" TEST_PKGS_SECURE="jsk_hrp2_ros_bridge"
- ROS_DISTRO=hydro USE_DEB=source NOT_TEST_INSTALL=true
- ROS_DISTRO=indigo USE_DEB=true
Expand Down
1 change: 0 additions & 1 deletion hrpsys_ros_bridge/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
idl/
models/
msg/Img_CameraCaptureService.msg
msg/OpenHRP_*
msg/OpenRTM_*
Expand Down
1 change: 1 addition & 0 deletions hrpsys_ros_bridge/catkin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,5 @@ add_rostest(test/test-import-python.test)
find_package(catkin COMPONENTS roseus QUIET)
if(roseus_FOUND)
generate_eusdoc(euslisp/rtm-ros-robot-interface.l)
add_rostest(test/hrpsys-samples/test_samplerobot_euslisp_unittests.launch)
endif()
67 changes: 67 additions & 0 deletions hrpsys_ros_bridge/euslisp/samplerobot-interface.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
(load "package://hrpsys_ros_bridge/euslisp/rtm-ros-robot-interface.l")
(require :samplerobot "package://hrpsys_ros_bridge/models/samplerobot.l")

(defclass samplerobot-interface
:super rtm-ros-robot-interface
:slots ())
(defmethod samplerobot-interface
(:init (&rest args)
(send-super* :init :robot samplerobot-robot args)
(mapcar #'(lambda (ctype)
(send self :add-controller ctype))
(send self :default-controller-list))
)
(:default-controller-list ()
(list :larm-controller
:rarm-controller
:torso-controller
:lhand-controller
:rhand-controller
:fullbody-controller))
(:default-controller ()
(mapcar #'(lambda (ctype) (car (send self ctype))) (send self :default-controller-list)))
(:fullbody-controller ()
(send-message self robot-interface :default-controller))
(:larm-controller ()
(list
(list
(cons :controller-action "/larm_controller/follow_joint_trajectory_action")
(cons :controller-state "/larm_controller/state")
(cons :action-type control_msgs::FollowJointTrajectoryAction)
(cons :joint-names (list "LARM_SHOULDER_P" "LARM_SHOULDER_R" "LARM_SHOULDER_Y" "LARM_ELBOW" "LARM_WRIST_Y" "LARM_WRIST_P")))))
(:rarm-controller ()
(list
(list
(cons :controller-action "/rarm_controller/follow_joint_trajectory_action")
(cons :controller-state "/rarm_controller/state")
(cons :action-type control_msgs::FollowJointTrajectoryAction)
(cons :joint-names (list "RARM_SHOULDER_P" "RARM_SHOULDER_R" "RARM_SHOULDER_Y" "RARM_ELBOW" "RARM_WRIST_Y" "RARM_WRIST_P")))))
(:torso-controller ()
(list
(list
(cons :controller-action "/torso_controller/follow_joint_trajectory_action")
(cons :controller-state "/torso_controller/state")
(cons :action-type control_msgs::FollowJointTrajectoryAction)
(cons :joint-names (list "WAIST_P" "WAIST_R" "CHEST")))))
(:lhand-controller ()
(list
(list
(cons :controller-action "/lhand_controller/follow_joint_trajectory_action")
(cons :controller-state "/lhand_controller/state")
(cons :action-type control_msgs::FollowJointTrajectoryAction)
(cons :joint-names (list "LARM_WRIST_R")))))
(:rhand-controller ()
(list
(list
(cons :controller-action "/rhand_controller/follow_joint_trajectory_action")
(cons :controller-state "/rhand_controller/state")
(cons :action-type control_msgs::FollowJointTrajectoryAction)
(cons :joint-names (list "RARM_WRIST_R")))))
)

(defun samplerobot-init (&rest args)
(if (not (boundp '*ri*))
(setq *ri* (instance* samplerobot-interface :init args)))
(if (not (boundp '*sr*))
(setq *sr* (instance samplerobot-robot :init)))
)
101 changes: 101 additions & 0 deletions hrpsys_ros_bridge/models/samplerobot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
##
## - collada_joint_name : euslisp_joint_name (start with :)
##

rleg:
- RLEG_HIP_R : rleg-crotch-r
- RLEG_HIP_P : rleg-crotch-p
- RLEG_HIP_Y : rleg-crotch-y
- RLEG_KNEE : rleg-knee-p
- RLEG_ANKLE_P : rleg-ankle-p
- RLEG_ANKLE_R : rleg-ankle-r
rarm:
- RARM_SHOULDER_P : rarm-shoulder-p
- RARM_SHOULDER_R : rarm-shoulder-r
- RARM_SHOULDER_Y : rarm-shoulder-y
- RARM_ELBOW : rarm-elbow-p
- RARM_WRIST_Y : rarm-wrist-y
- RARM_WRIST_P : rarm-wrist-p
- RARM_WRIST_R : rarm-wrist-r
lleg:
- LLEG_HIP_R : lleg-crotch-r
- LLEG_HIP_P : lleg-crotch-p
- LLEG_HIP_Y : lleg-crotch-y
- LLEG_KNEE : lleg-knee-p
- LLEG_ANKLE_P : lleg-ankle-p
- LLEG_ANKLE_R : lleg-ankle-r
larm:
- LARM_SHOULDER_P : larm-shoulder-p
- LARM_SHOULDER_R : larm-shoulder-r
- LARM_SHOULDER_Y : larm-shoulder-y
- LARM_ELBOW : larm-elbow-p
- LARM_WRIST_Y : larm-wrist-y
- LARM_WRIST_P : larm-wrist-p
- LARM_WRIST_R : larm-wrist-r
torso:
- WAIST_P : torso-waist-p
- WAIST_R : torso-waist-r
- CHEST : torso-waist-y

##
## end-coords
##
larm-end-coords:
translate : [0, 0, -0.12]
rotate : [0, 1, 0, 90]
parent : LARM_LINK6
rarm-end-coords:
translate : [0, 0, -0.12]
rotate : [0, 1, 0, 90]
parent : RARM_LINK6
lleg-end-coords:
translate : [0.00, 0, -0.07]
rleg-end-coords:
translate : [0.00, 0, -0.07]
head-end-coords:
translate : [0.08, 0, 0.13]
rotate : [0, 1, 0, 90]

##
## reset-pose
##
angle-vector:
# old reset-pose
# reset-pose : [0.0, -20.0, 0.0, 47.0, -27.0, 0.0, # rleg
# 30.0, 0.0, 0.0, -60.0, 9.0, -6.5, 36.5, # rarm
# 0.0, -20.0, 0.0, 47.0, -27.0, 0.0, # lleg
# 30.0, 0.0, 0.0, -60.0, -9.0, -6.5, -36.5, # larm
# 0.0, 0.0, 0.0] # torso
# openhrp reset pose from the initial line of OpenHRP-3.1/sample/controller/SampleController/etc/Sample.pos
reset-pose : [-0.004457, -21.6929, -0.01202, 47.6723, -25.93, 0.014025, # rleg
17.8356, -9.13759, -6.61188, -36.456, 0.0, 0.0, 0.0, # rarm
-0.004457, -21.6929, -0.01202, 47.6723, -25.93, 0.014025, # lleg
17.8356, 9.13759, 6.61188, -36.456, 0.0, 0.0, 0.0, # larm
0.0, 0.0, 0.0] # torso
reset-manip-pose : [0.0, -20.0, 0.0, 47.0, -27.0, 0.0, # rleg
30.0, 0.0, 0.0, -100.0, 9.0, -6.5, 36.5, # rarm
0.0, -20.0, 0.0, 47.0, -27.0, 0.0, # lleg
30.0, 0.0, 0.0, -100.0, -9.0, -6.5, -36.5, # larm
0.0, 0.0, 0.0] # torso


# for gazebo simulation
replace_xmls:
- match_rule:
tag: gazebo
attribute_name: reference
attribute_value: LLEG_LINK6
replaced_xml: '<gazebo reference="LLEG_LINK6">\n <kp>1000000.0</kp>\n <kd>100.0</kd>\n <mu1>1.5</mu1>\n <mu2>1.5</mu2>\n <fdir1>1 0 0</fdir1>\n <maxVel>10.0</maxVel>\n <minDepth>0.00</minDepth>\n </gazebo>'
- match_rule:
tag: gazebo
attribute_name: reference
attribute_value: RLEG_LINK6
replaced_xml: '<gazebo reference="RLEG_LINK6">\n <kp>1000000.0</kp>\n <kd>100.0</kd>\n <mu1>1.5</mu1>\n <mu2>1.5</mu2>\n <fdir1>1 0 0</fdir1>\n <maxVel>10.0</maxVel>\n <minDepth>0.00</minDepth>\n </gazebo>'
- match_rule:
attribute_name: effort
attribute_value: 100
replaced_attribute_value: 200
- match_rule:
attribute_name: velocity
attribute_value: 0.5
replaced_attribute_value: 6.0
Loading