Skip to content

Commit 7f94084

Browse files
committed
Initial release of AWS RoboMaker Hello World sample application
1 parent 74cf3c9 commit 7f94084

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+260253
-4
lines changed

NOTICE.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
This product includes software developed by
4+
Amazon Technologies, Inc (http://www.amazon.com/).

README.md

Lines changed: 109 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,112 @@
1-
## AWS Robomaker Sample Application Helloworld
1+
# AWS RoboMaker Sample Application - Hello World
22

3-
Each of these packages is a sample application using ROS to demonstrate the use of the RoboMaker service and integration of other AWS services with ROS.
3+
This demonstrates the structure of a ROS project that works with RoboMaker by creating a robot spinning in an empty world.
4+
5+
_RoboMaker sample applications include third-party software licensed under open-source licenses and is provided for demonstration purposes only. Incorporation or use of RoboMaker sample applications in connection with your production workloads or a commercial products or devices may affect your legal rights or obligations under the applicable open-source licenses. Source code information can be found [here](https://s3.console.aws.amazon.com/s3/buckets/robomaker-applications-us-east-1-72fc243f9355/hello-world/?region=us-east-1)._
6+
7+
## Requirements
8+
9+
- [ROS Kinetic](http://wiki.ros.org/kinetic/Installation/Ubuntu) - Other versions may work, however they have not been tested
10+
- [Colcon](https://colcon.readthedocs.io/en/released/user/installation.html) - Used for building and bundling the application.
11+
12+
## Build
13+
14+
### Pre-build commands
15+
16+
```bash
17+
sudo apt-get update
18+
rosdep update
19+
```
20+
21+
### Robot
22+
23+
```bash
24+
cd robot_ws
25+
rosws update
26+
rosdep install --from-paths src --ignore-src -r -y
27+
colcon build
28+
```
29+
30+
### Simulation
31+
32+
```bash
33+
cd simulation_ws
34+
rosws update
35+
rosdep install --from-paths src --ignore-src -r -y
36+
colcon build
37+
```
38+
39+
## Run
40+
41+
Launch the application with the following commands:
42+
43+
- *Running Robot Application on a Robot*
44+
```bash
45+
source robot_ws/install/local_setup.sh
46+
roslaunch hello_world_robot deploy_rotate.launch
47+
```
48+
49+
- *Running Robot Application Elsewhere*
50+
```bash
51+
source robot_ws/install/local_setup.sh
52+
roslaunch hello_world_robot rotate.launch
53+
```
54+
55+
- *Running Simulation Application*
56+
```bash
57+
source simulation_ws/install/local_setup.sh
58+
roslaunch hello_world_simulation empty_world.launch
59+
```
60+
61+
## Using this sample with RoboMaker
62+
63+
You first need to install colcon-ros-bundle. Python 3.5 or above is required.
64+
65+
```bash
66+
pip3 install colcon-ros-bundle
67+
```
68+
69+
After colcon-ros-bundle is installed you need to build your robot or simulation, then you can bundle with:
70+
71+
```bash
72+
# Bundling Robot Application
73+
cd robot_ws
74+
source install/local_setup.sh
75+
colcon bundle
76+
77+
# Bundling Simulation Application
78+
cd simulation_ws
79+
source install/local_setup.sh
80+
colcon bundle
81+
```
82+
83+
This produces the artifacts `robot_ws/build/output.tar.gz` and `simulation_ws/build/output.tar.gz` respectively.
84+
You'll need to upload these to an s3 bucket, then you can use these files to
85+
[create a robot application](https://docs.aws.amazon.com/robomaker/create-robot-application.html),
86+
[create a simulation application](https://docs.aws.amazon.com/robomaker/create-simulation-application.html),
87+
and [create a simulation job](https://docs.aws.amazon.com/robomaker/create-simulation-job.html) in RoboMaker.
88+
89+
## ROS Nodes launched by this Sample
90+
91+
### Nodes created by this sample
92+
93+
```
94+
/rotate
95+
```
96+
97+
## ROS Topics used by this Sample
98+
99+
```
100+
/clock
101+
/cmd_vel
102+
```
103+
104+
## License
105+
106+
MIT-0 - See LICENSE.txt for further information
107+
108+
## How to Contribute
109+
110+
Create issues and pull requests against this Repository on Github
4111
5-
## License Summary
6112
7-
This sample code is made available under a modified MIT license. See the LICENSE file.

roboMakerSettings.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"runConfigurations": [{
3+
"id": "HelloWorld_Cfg01",
4+
"name": "HelloWorld Robot",
5+
"type": "colcon build",
6+
"cfg": {
7+
"workingDir": "./HelloWorld/robot_ws",
8+
"cmdArgs": ""
9+
}
10+
}, {
11+
"id": "HelloWorld_Cfg02",
12+
"name": "HelloWorld Robot",
13+
"type": "colcon bundle",
14+
"cfg": {
15+
"workingDir": "./HelloWorld/robot_ws",
16+
"cmdArgs": ""
17+
}
18+
}, {
19+
"id": "HelloWorld_Cfg03",
20+
"name": "HelloWorld Simulation",
21+
"type": "colcon build",
22+
"cfg": {
23+
"workingDir": "./HelloWorld/simulation_ws",
24+
"cmdArgs": ""
25+
}
26+
}, {
27+
"id": "HelloWorld_Cfg04",
28+
"name": "HelloWorld Simulation",
29+
"type": "colcon bundle",
30+
"cfg": {
31+
"workingDir": "./HelloWorld/simulation_ws",
32+
"cmdArgs": ""
33+
}
34+
}, {
35+
"id": "HelloWorld_SimulationJob1",
36+
"name": "HelloWorld",
37+
"type": "simulation",
38+
"cfg": {
39+
"robotApp": {
40+
"name": "RoboMakerHelloWorldRobot",
41+
"s3Bucket": "<bucket name for your robot bundle>",
42+
"sourceBundleFile": "./HelloWorld/robot_ws/bundle/output.tar.gz",
43+
"architecture": "X86_64",
44+
"robotSoftwareSuite": {
45+
"version": "Kinetic",
46+
"name": "ROS"
47+
},
48+
"launchConfig": {
49+
"packageName": "hello_world_robot",
50+
"launchFile": "rotate.launch"
51+
}
52+
},
53+
"simulationApp": {
54+
"name": "RoboMakerHelloWorldSimulation",
55+
"s3Bucket": "<bucket name for your simulation bundle>",
56+
"sourceBundleFile": "./HelloWorld/simulation_ws/bundle/output.tar.gz",
57+
"architecture": "X86_64",
58+
"launchConfig": {
59+
"packageName": "hello_world_simulation",
60+
"launchFile": "empty_world.launch"
61+
},
62+
"robotSoftwareSuite": {
63+
"version": "Kinetic",
64+
"name": "ROS"
65+
},
66+
"simulationSoftwareSuite": {
67+
"name": "Gazebo",
68+
"version": "7"
69+
},
70+
"renderingEngine": {
71+
"name": "OGRE",
72+
"version": "1.x"
73+
}
74+
},
75+
"simulation": {
76+
"outputLocation": "<bucket name for your job outputs>",
77+
"failureBehavior": "Fail",
78+
"maxJobDurationInSeconds": 28800,
79+
"iamRole": "<your B9 role ARN>"
80+
}
81+
}
82+
},
83+
{
84+
"id": "HelloWorld_wf1",
85+
"type": "workflow",
86+
"name": "HelloWorld - Build and Bundle All",
87+
"runCfgIds": ["HelloWorld_Cfg01", "HelloWorld_Cfg02", "HelloWorld_Cfg03", "HelloWorld_Cfg04"]
88+
}
89+
]
90+
}

robot_ws/.rosinstall

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# kinetic.rosinstall
2+
- setup-file: {local-name: /opt/ros/kinetic/setup.sh}

robot_ws/src/LICENSE.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2018 Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
################################################################################
2+
# Set minimum required version of cmake, project name and compile options
3+
################################################################################
4+
cmake_minimum_required(VERSION 2.8.3)
5+
project(hello_world_robot)
6+
7+
################################################################################
8+
# Find catkin packages and libraries for catkin and system dependencies
9+
################################################################################
10+
find_package(catkin REQUIRED COMPONENTS
11+
rospy
12+
std_msgs
13+
sensor_msgs
14+
geometry_msgs
15+
nav_msgs
16+
)
17+
18+
################################################################################
19+
# Setup for python modules and scripts
20+
################################################################################
21+
catkin_python_setup()
22+
23+
################################################################################
24+
# Declare ROS messages, services and actions
25+
################################################################################
26+
27+
################################################################################
28+
# Declare ROS dynamic reconfigure parameters
29+
################################################################################
30+
31+
################################################################################
32+
# Declare catkin specific configuration to be passed to dependent projects
33+
################################################################################
34+
catkin_package(
35+
CATKIN_DEPENDS
36+
rospy
37+
std_msgs
38+
sensor_msgs
39+
geometry_msgs
40+
nav_msgs
41+
message_runtime
42+
)
43+
44+
################################################################################
45+
# Build
46+
################################################################################
47+
include_directories(
48+
include
49+
${catkin_INCLUDE_DIRS}
50+
)
51+
52+
################################################################################
53+
# Install
54+
################################################################################
55+
catkin_install_python(PROGRAMS
56+
nodes/rotate
57+
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
58+
)
59+
60+
install(DIRECTORY launch
61+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
62+
)
63+
64+
install(DIRECTORY deploymentScripts
65+
DESTINATION ${CATKIN_GLOBAL_SHARE_DESTINATION}
66+
)
67+
68+
################################################################################
69+
# Test
70+
################################################################################
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# This is a script which can be run after launching the ROS processes.
3+
# You can include a post-check of ROS processes in this post-launch file.
4+
# Non-zero exit status from script would cause robot deployment failure.
5+
# Use "deploymentScripts/post_launch_file.sh" as the postLaunchFile path.
6+
7+
echo Hello World, post-launch
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# This is a script which can be run before running the ROS launch file.
3+
# You can include a pre-check of robot environment in this pre-launch file.
4+
# Non-zero exit status from script would cause robot deployment failure.
5+
# Use "deploymentScripts/pre_launch_file.sh" as the preLaunchFile path.
6+
7+
echo Hello World, pre-launch
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<launch>
2+
<!-- bringup turtlebot3 -->
3+
<include file="$(find turtlebot3_bringup)/launch/turtlebot3_robot.launch"/>
4+
5+
<!-- deploy rotate system -->
6+
<include file="$(find hello_world_robot)/launch/rotate.launch">
7+
<arg name="use_sim_time" value="false"/>
8+
</include>
9+
</launch>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<launch>
2+
<!--
3+
Using simulation time means nodes initialized after this
4+
will not use the system clock for its ROS clock and
5+
instead wait for simulation ticks.
6+
7+
See http://wiki.ros.org/Clock
8+
9+
Note: set to false for deploying to a real robot.
10+
-->
11+
<arg name="use_sim_time" default="true"/>
12+
<param name="use_sim_time" value="$(arg use_sim_time)"/>
13+
14+
<!-- Rotate the robot on launch -->
15+
<node pkg="hello_world_robot" type="rotate" name="rotate" output="screen"/>
16+
</launch>

0 commit comments

Comments
 (0)