Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS-1113: Add clarification for running code remotely to client SDK Run Code page #1819

Merged
merged 11 commits into from
Sep 21, 2023

Conversation

sguequierre
Copy link
Collaborator

  • Trying to explain the "why" of this use case-- internal docs feedback from @mcvella and team

@sguequierre sguequierre requested a review from mcvella September 13, 2023 18:26
@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Sep 13, 2023
@sguequierre sguequierre changed the title Add clarification for running code remotely DOCS-1113: Add clarification for running code remotely to client SDK Run Code page Sep 13, 2023
@viambot
Copy link
Member

viambot commented Sep 13, 2023

Overall readability score: 54.69 (🟢 +0)

File Readability
run.md 49.3 (🟢 +0.25)
View detailed metrics

🟢 - Shows an increase in readability
🔴 - Shows a decrease in readability

File Readability FRE GF ARI CLI DCRS
run.md 49.3 41.19 11.98 15.6 12.13 7.43
  🟢 +0.25 🔴 -2.24 🔴 -0.52 🔴 -0.1 🟢 +0.81 🟢 +0.16

Averages:

  Readability FRE GF ARI CLI DCRS
Average 54.69 46.17 10.87 13.32 11.82 7.77
  🟢 +0 🔴 -0.01 🟢 +0 🟢 +0 🟢 +0 🟢 +0
View metric targets
Metric Range Ideal score
Flesch Reading Ease 100 (very easy read) to 0 (extremely difficult read) 60
Gunning Fog 6 (very easy read) to 17 (extremely difficult read) 8 or less
Auto. Read. Index 6 (very easy read) to 14 (extremely difficult read) 8 or less
Coleman Liau Index 6 (very easy read) to 17 (extremely difficult read) 8 or less
Dale-Chall Readability 4.9 (very easy read) to 9.9 (extremely difficult read) 6.9 or less

docs/program/run.md Outdated Show resolved Hide resolved
docs/program/run.md Outdated Show resolved Hide resolved
docs/program/run.md Outdated Show resolved Hide resolved
docs/program/run.md Outdated Show resolved Hide resolved

For example:
Most of the time, as long as both you and your robot are connected to the internet, you will want to upload code to your robot remotely.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense to have in a section that has the heading "run code remotely" because you're not describing that - you're describing moving the code to the robot and running it there instead.

Copy link
Collaborator Author

@sguequierre sguequierre Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm-- this is the ask itself. And I can change the heading but you are running code remotely, like remotely from the computer where the robot is located, then it "moves" the code to the robot. Vs on-robot, you are on the same computer. I believe remote is a fairly standard term for this but I am slightly head-scratched by this as well so I can see why it's confusing. What would you think about Run Code Remotely from the Robot? @npentrel Or do you have any other suggestions?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if you are running the code from the robot you are by definition not remote? I think this conflates both concepts. Here's my understanding with my guardian robot as the example. I can:

  1. Run the code that makes it move and follow my dog from my macbook. Then I am running the code remotely. The python code does not get "moved" to the robot. A client session is created and the code running on my macbook will send instructions to the viam-server instance. If the connection drops because my mac loses wifi, the robot stops moving because the code is not actually on the robot now, it was just receiving the commands resulting from the code.
  2. Run the code locally on the robot. Then I am putting the python file for my robot on the raspberry pi that is the heart of the robot. This is what I actually do and then I have the script automatically start when viam-server is running.

Now, it occurs to me that it could also be that by "remote" we might mean not on the same WAN/LAN. I'm not sure that's clear. But also then - no code is uploaded.

^ Does this make it clearer? Explaining it with an example may help the reader's understanding here

Copy link
Collaborator Author

@sguequierre sguequierre Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is super helpful, thank you @npentrel!! I was confused thinking about how it worked/didn't realize "uploading code to the robot" was inaccurate. Will edit to have the use case with the macbook to make that more clear.

## Run Code Remotely
### Authentication

You must reference a robot's location secret to authenticate yourself to the robot.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a user would know what they are supposed to do to "reference a robot's location secret", maybe include or add would be better?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see now you were just movign this up... We can fix it separetely

docs/program/run.md Outdated Show resolved Hide resolved
docs/program/run.md Outdated Show resolved Hide resolved
Most of the time, as long as both you and your robot are connected to the internet, you will want to run code on your robot remotely.
The advantage of this method is that your robot and your computer do not have to be connected to the same WAN/LAN to issue control commands.
You can remotely control your robot with any application you implement from anywhere in the world.
For example, you can run code on your personal computer, creating a client [session](/program/apis/sessions/), where the code running on that computer sends instructions to your robot's computer's `viam-server` instance over the internet.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@npentrel added use case here-- tried to keep wording simple but LMK if inaccurate

docs/program/run.md Outdated Show resolved Hide resolved

Do this by running a command to execute the program in the terminal of a machine with the appropriate programming language and Viam SDK installed.
Most of the time, as long as both you and your robot are connected to the internet, you will want to run code on your robot remotely.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run code to control the robot remotely

@viambot
Copy link
Member

viambot commented Sep 21, 2023

You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/01109043ab3aa45f6ef314fc10894c90f41f1783/public

@sguequierre sguequierre merged commit 4b09eca into viamrobotics:main Sep 21, 2023
8 checks passed
@sguequierre sguequierre deleted the DOCS-1113/improve-run-page branch September 21, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to build This pull request is marked safe to build from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants