Skip to content

Commit

Permalink
update network details for take home and create-robot-app
Browse files Browse the repository at this point in the history
  • Loading branch information
Joyce committed Nov 25, 2024
1 parent 1b0b2c7 commit a6eceac
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
22 changes: 13 additions & 9 deletions site/viamguides/src/drive-rover-ts/drive-rover-ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Duration: 2

1. Go to [Try Viam](https://app.viam.com/try) in your web browser to remotely control a rover pre-configured with components in the NYC Viam robotics lab. This may take up to 30 seconds.
![Try Viam landing page](assets/tryViam.png)

> aside negative
> You can also use [your own Viam rover](https://docs.viam.com/appendix/try-viam/rover-resources/) or another wheeled robot.
Expand All @@ -74,21 +75,22 @@ Duration: 2
Now that you know how to manually control the rover using the Viam app, let's control the rover programmatically with code.

1. From the command line within your terminal window, let's use a command line utility to quickly set up a new TypeScript project. Input the following command:
```bash
$ npm create robot-app
```
```bash
$ npm create robot-app
```
1. At the command-line prompt, input your project name. Or hit **Enter** to accept the default project name, `my-viam-project`.
![command line prompt](assets/myViamProject.png)
1. Select the project template `controlRover`, and hit **Enter**.
1. Once the project setup is completed, follow the command-line instructions. Navigate into your new project directory. In the example shown below, we are using the default project name `my-viam-project`.
```bash
$ cd my-viam-project
```
```bash
$ cd my-viam-project
```
1. In the Viam app, find the **CONNECT** page, select the **TypeScript** SDK, and turn on **Include API key** to reveal your machine credentials within the code sample. Use these machine credentials to update the `.env` file in your new project directory, and save your changes.
![machine credentials](assets/viamMachineCredentials.png)
1. Start the application server. Your web app should be running at `http://localhost:5173/`
```bash
$ npm start
```
```bash
$ npm start
```
1. Open your browser's devtools, for example, by right-clicking and selecting **Inspect**, to see the browser's console logs. And position the browser window so you can once again see the `overhead-cam` in the CONTROL tab within the Viam app. Press the **Click me** button in the web application to see the console logs and camera feed of the rover in the robotics lab at the same time.
![drive it](assets/driveIt.png)
1. In your IDE, edit `src/main.ts` to change the logic being run. Edit `index.html` to change the layout of the web application.
Expand All @@ -103,9 +105,11 @@ Duration: 2
> If you want more time to keep playing with your borrowed rover, hit the **Extend** button in the top right of the page.
### What You Learned

- How to drive a rover in a square using the Viam TypeScript SDK
- How to use environment variables with your Viam machine

### Related Resources

- [Detect people with a webcam](https://docs.viam.com/get-started/detect-people/): use the borrowed rover's webcam or the webcam on your own laptop to deploy and use a machine learning model with a vision service
- Explore other [Viam SDK libraries](https://docs.viam.com/sdks/), besides TypeScript for backend, frontend, and mobile development.
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@ Participants have several options for continuing their projects beyond the works
- **Take-home projects**: For participants allowed to take their projects home after the workshop, the `viam-agent` on the Raspberry Pi can simplify the setup process:

- **Provisioning mode**: Upon rebooting the Raspberry Pi in a new environment like at home, the `viam-agent` automatically creates a Wi-Fi hotspot if it cannot connect to a known network.
- **Connect to the hotspot**: Look for a network named `viam-setup-HOSTNAME` in your list of available Wi-Fi networks, where `HOSTNAME` is the custom hostname you set during the workshop, and `viamsetup` is the default password. Connect your laptop to this network. Go to the provisioning portal at `http://viam.setup/` in a browser to follow [the on-screen instructions](https://docs.viam.com/fleet/provision/#end-user-experience) to configure the Raspberry Pi for your home Wi-Fi.
- **Connect to the hotspot**: Look for a network named `viam-setup-HOSTNAME` in your list of available Wi-Fi networks, where `HOSTNAME` is the custom hostname you set during the workshop, and `viamsetup` is the default password. Connect your laptop to this network.
- **Provide network information for the machine**: Go to the provisioning portal at `http://viam.setup/` in a browser to follow [the on-screen instructions](https://docs.viam.com/fleet/provision/#end-user-experience) to configure the Raspberry Pi for your home Wi-Fi.

- **Remote control**: If participants are not allowed to take their projects home after the workshop, but want to continue working on their projects from home, they can access the Raspberry Pi remotely from anywhere in the world and continue accessing sensor data. If participants do not have SSH access into the Raspberry Pi, participants can write and run code on their laptops from home.

Expand Down
5 changes: 4 additions & 1 deletion site/viamguides/src/workshop-rover/workshop-rover.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ Now that you know how to manually control the rover using the Viam app, let's co
```
1. At the command-line prompt, input your project name. Or hit **Enter** to accept the default project name, `my-viam-project`.
![command line prompt](assets/myViamProject.png)
1. Select the project template `controlRover`, and hit **Enter**.
1. Once the project setup is completed, follow the command-line instructions. Navigate into your new project directory. In the example shown below, we are using the default project name `my-viam-project`.
```bash
$ cd my-viam-project
Expand Down Expand Up @@ -391,7 +392,8 @@ Participants have several options for continuing their projects beyond the works
- **Take-home projects**: For participants allowed to take their rover home after the workshop, the `viam-agent` on the Raspberry Pi can simplify the setup process:

- **Provisioning mode**: Upon rebooting the Raspberry Pi in a new environment like at home, the `viam-agent` automatically creates a Wi-Fi hotspot if it cannot connect to a known network.
- **Connect to the hotspot**: Look for a network named `viam-setup-HOSTNAME` in your list of available Wi-Fi networks, where `HOSTNAME` is the custom hostname you set during the workshop, and `viamsetup` is the default password. Connect your laptop to this network. Go to the provisioning portal at `http://viam.setup/` in a browser to follow [the on-screen instructions](https://docs.viam.com/fleet/provision/#end-user-experience) to configure the Raspberry Pi for your home Wi-Fi.
- **Connect to the hotspot**: Look for a network named `viam-setup-HOSTNAME` in your list of available Wi-Fi networks, where `HOSTNAME` is the custom hostname you set during the workshop, and `viamsetup` is the default password. Connect your laptop to this network.
- **Provide network information for the machine**: Go to the provisioning portal at `http://viam.setup/` in a browser to follow [the on-screen instructions](https://docs.viam.com/fleet/provision/#end-user-experience) to configure the Raspberry Pi for your home Wi-Fi.

- **Remote control**: If participants cannot take their rover home but want to continue their projects, they can access their rover remotely:

Expand Down Expand Up @@ -444,6 +446,7 @@ Here are some ideas for expanding and enhancing the current project to create au
- [Navigate with a rover base](https://docs.viam.com/tutorials/services/navigate-with-rover-base/) tutorial: to set up user-defined waypoints for your rover to move to in the order that you specify or dynamically adapt using inputs like GPS or vision
- [Train a custom ML model](https://docs.viam.com/how-tos/train-deploy-ml/) guide: to enable object detection or classification and program the rover to act accordingly, such as moving toward or avoiding detected objects
- [Add sensors and other components](https://docs.viam.com/appendix/try-viam/rover-resources/rover-tutorial/#extensibility) to extend the functionality of your rover
- [Use the Viam mobile SDK to build an iOS or Android application](https://docs.viam.com/sdks/#mobile-sdk) to control the machine's components

<img src="assets/logistics.png" alt="viam icons" width="200">

Expand Down

0 comments on commit a6eceac

Please sign in to comment.