You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,18 @@
2
2
3
3
OpenAI server node for ROS2 Applications
4
4
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
+
5
17
## Setup
6
18
7
19
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:
16
28
17
29
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.
18
30
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"`
20
32
21
33
Here's an example that returns a full string.
22
34
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?"`
24
36
25
37
There's an example client which sends an image of a wooden table and prompts whether it is indeed a wooden table:
0 commit comments