forked from jsk-ros-pkg/jsk_robot
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jsk_spot_startup] add sample_elevator server
- Loading branch information
1 parent
df240b0
commit 4f75b8c
Showing
5 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
jsk_spot_robot/jsk_spot_startup/apps/sample_elevator/sample_elevator.app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
3 changes: 3 additions & 0 deletions
3
jsk_spot_robot/jsk_spot_startup/apps/sample_elevator/sample_elevator.interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
published_topics: {} | ||
subscribed_topics: {} | ||
|
28 changes: 28 additions & 0 deletions
28
jsk_spot_robot/jsk_spot_startup/apps/sample_elevator/sample_elevator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
9 changes: 9 additions & 0 deletions
9
jsk_spot_robot/jsk_spot_startup/apps/sample_elevator/sample_elevator.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |