Skip to content

Commit

Permalink
[jsk_spot_startup] add sample_eye_rotation app
Browse files Browse the repository at this point in the history
  • Loading branch information
sktometometo committed Apr 18, 2023
1 parent a0a214c commit 55ab219
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env roseus

(ros::load-ros-manifest "geometry_msgs")
(load "package://spoteus/spot-interface.l")
(spot-init)

(setq *pi* 3.14159265358979)

(setq *right-eye-topic* "/right_eye/look_at")
(setq *left-eye-topic* "/left_eye/look_at")

(setq *right-eye-target* (instance geometry_msgs::Point :init))
(setq *left-eye-target* (instance geometry_msgs::Point :init))

(ros::advertise *right-eye-topic* geometry_msgs::Point 1)
(ros::advertise *left-eye-topic* geometry_msgs::Point 1)

(setq index 0)
(ros::rate 10)
(while (ros::ok)
(ros::sleep)
(send *right-eye-target* :x (cos (/ (* 2 *pi* index) 10)))
(send *right-eye-target* :y (sin (/ (* 2 *pi* index) 10)))
(send *left-eye-target* :x (cos (/ (* 2 *pi* index) 10)))
(send *left-eye-target* :y (sin (/ (* 2 *pi* index) 10)))
(ros::publish *right-eye-topic* *right-eye-target*)
(ros::publish *left-eye-topic* *left-eye-target*)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
display: Sample Eye Rotation
platform: spot
launch: jsk_spot_startup/sample_eye_rotation.xml
interface: jsk_spot_startup/sample_eye_rotation.interface
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
published_topics: {}
subscribed_topics: {}

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<launch>
<node pkg="jsk_spot_startup" type="sample-eye-rotation.l" name="sample_eye_rotation"/>
</launch>

0 comments on commit 55ab219

Please sign in to comment.