Skip to content

Commit

Permalink
Merge pull request #46 from snozawa/add_dependency_on_pr2_mechanism_m…
Browse files Browse the repository at this point in the history
…odel

Merged.
  • Loading branch information
snozawa committed Jun 12, 2014
2 parents 9ce24b8 + 1f891c2 commit ddbb397
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 36 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ matrix:
allow_failures:
- env: ROS_DISTRO=indigo ROSWS=wstool BUILDER=catkin USE_DEB=true
- env: ROS_DISTRO=indigo ROSWS=wstool BUILDER=catkin USE_DEB=false
before_install: # Use this to prepare the system to install prerequisites or dependencies
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
- sudo apt-get update -qq
install:
- sudo apt-get install -qq -y ros-$ROS_DISTRO-pr2-mechanism;
script: source .travis/travis.sh
notifications:
email:
Expand Down
2 changes: 1 addition & 1 deletion euscollada/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ convert_to_collada()

## pr2.l
rosbuild_find_ros_package(pr2_mechanism_model)
if(pr2_mechanism_model_FOUND)
if(EXISTS "${pr2_mechanism_model_PACKAGE_PATH}")
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_SOURCE_DIR}/pr2.l
COMMAND rosrun euscollada pr2.sh
Expand Down
68 changes: 33 additions & 35 deletions euscollada/pr2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,36 @@ if [ "$?" != 0 ] ; then exit ; fi
rosrun euscollada collada2eus pr2.dae pr2.yaml pr2.l.$$.tmp; mv pr2.l.$$.tmp pr2.l
if [ "$?" != 0 ] ; then exit ; fi

# rosrun roseus roseus "\
# (progn \
# (load \"package://euscollada/pr2.l\") \
# (load \"package://pr2eus/pr2-utils.l\") \
# (if (and x::*display* (> x::*display* 0) (not (boundp '*irtviewer*))) (make-irtviewer :title \"pr2.sh\")) \
# (if (not (boundp '*pr2*)) (pr2)) \
# \
# (send *pr2* :move-to (make-coords) :world) \
# (send *pr2* :reset-pose) \
# (when (boundp '*irtviewer*) (objects (list *pr2*))) \
# (setq i 0) \
# (do-until-key \
# (print (list i (send *pr2* :torso :waist-z :joint-angle))) \
# (setq p (make-coords :pos \
# (v+ (float-vector 400 -400 1000) \
# (float-vector \
# 0 \
# (* 300 (sin (* pi (/ i 25.0)))) \
# (* 500 (sin (* pi (/ i 50.0)))))))) \
# (send *pr2* :inverse-kinematics p \
# :look-at-target t \
# :rotation-axis :z \
# :use-base 0.1 \
# ) \
# (when (boundp '*irtviewer*) \
# (send *irtviewer* :objects (list *pr2* p)) \
# (send *irtviewer* :draw-objects) \
# (x::window-main-one)) \
# (incf i) \
# (when (> i 100) (exit 0)) \
# ) \
# (if (boundp '*irtviewer*) (send-all (send *pr2* :links) :draw-on :flush t))\
# (exit) \
# ) \
# "
rosrun roseus roseus lib/llib/unittest.l "(init-unit-test)" "\
(progn \
(load \"package://euscollada/pr2.l\") \
(if (and x::*display* (> x::*display* 0) (not (boundp '*irtviewer*))) (make-irtviewer :title \"pr2.sh\")) \
(if (not (boundp '*pr2*)) (pr2)) \
\
(send *pr2* :move-to (make-coords) :world) \
(send *pr2* :reset-pose) \
(when (boundp '*irtviewer*) (objects (list *pr2*))) \
(setq i 0) \
(do-until-key \
(print (list i (send *pr2* :torso :waist-z :joint-angle))) \
(setq p (make-coords :pos \
(v+ (float-vector 400 -400 1000) \
(float-vector \
0 \
(* 100 (sin (* pi (/ i 25.0)))) \
(* 200 (sin (* pi (/ i 50.0)))))))) \
(send *pr2* :rarm :inverse-kinematics p \
:look-at-target t \
:rotation-axis :z \
) \
(when (boundp '*irtviewer*) \
(send *irtviewer* :objects (list *pr2* p)) \
(send *irtviewer* :draw-objects) \
) \
(incf i) \
(when (> i 100) (exit 0)) \
) \
(if (boundp '*irtviewer*) (send-all (send *pr2* :links) :draw-on :flush t))\
(exit) \
) \
"

0 comments on commit ddbb397

Please sign in to comment.