Skip to content

Commit

Permalink
[jsk_spot_startup] add sample_elevator server
Browse files Browse the repository at this point in the history
  • Loading branch information
sktometometo committed Nov 22, 2023
1 parent df240b0 commit 4f75b8c
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jsk_spot_robot/jsk_spot_startup/apps/app.installed
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ apps:
dispay: Hello World
- app: jsk_spot_startup/head_lead_demo
dispay: Head Lead Demo

- app: jsk_spot_startup/sample_elevator
dispay: Sample Elevator
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
display: Sample Elevator
platform: spot
launch: jsk_spot_startup/sample_elevator.xml
interface: jsk_spot_startup/sample_elevator.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,28 @@
#!/usr/bin/env python

import rospy
from spot_ros_client.libspotros import SpotRosClient
import actionlib
from jsk_spot_behavior_msgs.msg import NavigationAction
from jsk_spot_behavior_msgs.msg import NavigationActionGoal


if __name__ == '__main__':

rospy.init_node("sample_elevator")
client = SpotRosClient()

behavior_client = actionlib.SimpleActionClient("/spot_behavior_manager_server/execute_behaviors", NavigationAction)
behavior_client.wait_for_server()

client.claim()
client.power_on()
client.undock()

behavior_client.send_goal_and_wait(NavigationActionGoal(target_node_id="eng2_3FElevator"))
result = behavior_client.get_result()

behavior_client.send_goal_and_wait(NavigationActionGoal(target_node_id="eng2_73B2_dock"))
result = behavior_client.get_result()

client.dock(521)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<launch>
<node pkg="jsk_spot_startup" type="sample_elevator.py" name="sample_elevator"/>

<include
file="$(find jsk_spot_behavior_manager)/launch/demo.launch"
>
<arg name="initial_node_id" value="eng2_73B2_dock" />
</include>
</launch>

0 comments on commit 4f75b8c

Please sign in to comment.