Skip to content

Commit d96020f

Browse files
committed
Add use cases to the Readme
1 parent 30bf91b commit d96020f

File tree

3 files changed

+31
-32
lines changed

3 files changed

+31
-32
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,18 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: CI
42

5-
# Controls when the workflow will run
6-
on:
7-
# Triggers the workflow on push or pull request events but only for the "main" branch
8-
push:
9-
branches: [ "main" ]
10-
pull_request:
11-
branches: [ "main" ]
12-
13-
# Allows you to run this workflow manually from the Actions tab
14-
workflow_dispatch:
3+
on: [push, pull_request]
154

16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
175
jobs:
18-
# This workflow contains a single job called "build"
19-
build:
20-
# The type of runner that the job will run on
6+
industrial_ci:
7+
strategy:
8+
matrix:
9+
env:
10+
- {ROS_DISTRO: humble, ROS_REPO: main}
11+
- {ROS_DISTRO: jazzy, ROS_REPO: main}
2112
runs-on: ubuntu-latest
22-
23-
# Steps represent a sequence of tasks that will be executed as part of the job
13+
env:
14+
UPSTREAM_WORKSPACE: upstream.repos
2415
steps:
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26-
- uses: actions/checkout@v4
27-
28-
# Runs a single command using the runners shell
29-
- name: Run a one-line script
30-
run: echo Hello, world!
31-
32-
# Runs a set of commands using the runners shell
33-
- name: Run a multi-line script
34-
run: |
35-
echo Add other actions to build,
36-
echo test, and deploy your project.
16+
- uses: actions/checkout@v3
17+
- uses: 'ros-industrial/industrial_ci@master'
18+
env: ${{matrix.env}}

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
OpenAI server node for ROS2 Applications
44

5+
## What is this useful for?
6+
7+
If you don't have an image processing pipeline or a GPU on your robot, calls to OpenAI can replace much of that functionality. As of July 2024 we generally recommend yes/no questions, otherwise you will need to parse the response yourself. This package includes a simple filter which parses for yes/no. For example:
8+
9+
- Is it safe for the robot to drive forward? Please respond in one word, yes or no.
10+
- Is the door open? Please respond in one word, yes or no.
11+
- Is there a customer at that table? Please respond in one word, yes or no.
12+
- Did the robot successfully grasp the cube? Please respond in one word, yes or no.
13+
- Does the control panel look identical to the last time I checked? Please respond in one word, yes or no.
14+
15+
Some of these examples are useful for reinforcement learning, i.e. for determining if a reward was earned.
16+
517
## Setup
618

719
Requires an OpenAI key as described here: https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key
@@ -16,11 +28,11 @@ Here's a quick example:
1628

1729
Send it a prompt. Here's an example that returns a bool from a yes/no question. Not that the `image` field of the service request may be left empty.
1830

19-
`ros2 service call /openai_bool_response ai_msgs/srv/BoolResponse prompt:\ "are you a pirate? please respond with a one-word answer, yes or no"`
31+
`ros2 service call /openai_bool_response ai_msgs/srv/BoolResponse prompt:\ "Are you a pirate? Please respond with a one-word answer, yes or no"`
2032

2133
Here's an example that returns a full string.
2234

23-
`ros2 service call /openai_string_response ai_msgs/srv/StringResponse prompt:\ "are you a pirate?"`
35+
`ros2 service call /openai_string_response ai_msgs/srv/StringResponse prompt:\ "Are you a pirate?"`
2436

2537
There's an example client which sends an image of a wooden table and prompts whether it is indeed a wooden table:
2638

upstream.repos

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repositories:
2+
ai_msgs:
3+
type: git
4+
url: https://github.com/robosoft/ai_msgs.git
5+
version: main

0 commit comments

Comments
 (0)