Skip to content

Conversation

nathan-contino
Copy link
Contributor

@nathan-contino nathan-contino commented Jul 14, 2025

  • Builds out three proper guides demonstrating in-module autonomous decision-making logic.
  • Removes the minimal, not terribly useful 'industrial' examples from the previous page.
  • Fixes some minor cosmetic issues in the Line Following Robot tutorial.
  • To keep the Data & AI sidebar from scrolling, relocated all API links to an "APIs" section.

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Jul 14, 2025
Copy link

netlify bot commented Jul 14, 2025

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 0c2e263
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/687eb344e591a4000805f5a2
😎 Deploy Preview https://deploy-preview-4473--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 39 (🔴 down 9 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@nathan-contino nathan-contino marked this pull request as draft July 14, 2025 19:43
@nathan-contino nathan-contino marked this pull request as ready for review July 21, 2025 21:06
@viambot
Copy link
Member

viambot commented Jul 21, 2025

It looks like the following files may have been renamed. Please ensure you set all needed aliases:
rename docs/data-ai/reference/{ => apis}/data-client.md (69%) rename docs/data-ai/reference/{ => apis}/data-management-client.md (59%) rename docs/data-ai/reference/{ => apis}/ml-model-client.md (62%) rename docs/data-ai/reference/{ => apis}/ml-training-client.md (65%) rename docs/data-ai/reference/{ => apis}/vision-client.md (62%)

Copy link
Contributor

@JessamyT JessamyT left a comment

Choose a reason for hiding this comment

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

So high-level, I am curious about the objective of this PR. It seems like it creates a rather lengthy page that duplicates other tutorial and how-to content. Each section in here is covering configuring a (specific) machine, generating module stub code, modifying the code to follow a different pattern from what the generator generates, and also writing logic that makes decisions autonomously.

Would it perhaps be better to have targeted code snippets in a how-to, and then have full things like this in tutorials? Then this page can just focus on the making autonomous decisions and be much shorter?

I'm also curious what the plan is for maintaining these code examples as the platform including the module generator change; the hot reloading flow for example should improve soon.

@@ -219,46 +219,46 @@ Next, navigate to the **CONFIGURE** tab of your machine's page.

1. **Add a vision service.**

Next, add a vision service [detector](/dev/reference/apis/services/vision/#detections):
Next, add a vision service [detector](/dev/reference/apis/services/vision/#detections):
Copy link
Contributor

Choose a reason for hiding this comment

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

bah why must GH be so bad at recognizing whitespace-only diffs ;(

Comment on lines +30 to +31
Connect your SCUTTLE base to your SBC.
Add the following `components` configuration to create board, base, and motor components in Viam so you can control your SCUTTLE base:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would make this way less scuttle-specific. You could link to the tutorial as an example but this feels like too much detail and too specific for an AI section guide.

I'd ditch the config below too since it takes up so much length on the page but won't apply to all bases; just tell them to configure their base with a link to https://docs.viam.com/operate/reference/components/base/

Comment on lines +120 to +127
- **module name**: "autonomous_example_module"
- **language**: Python
- **visibility**: private
- **organization ID**: your organization ID, found on the Viam organization settings page
- **resource to be added to the module**: Generic Service
- **model name**: "line_follower"
- **Enable cloud build**: yes
- **Register module**: yes
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **module name**: "autonomous_example_module"
- **language**: Python
- **visibility**: private
- **organization ID**: your organization ID, found on the Viam organization settings page
- **resource to be added to the module**: Generic Service
- **model name**: "line_follower"
- **Enable cloud build**: yes
- **Register module**: yes
- **Module name**: `autonomous_example_module`
- **Language**: Python
- **Visibility**: Private
- **Organization ID**: Your organization ID, found on the Viam organization settings page
- **Resource to be added to the module**: Generic Service
- **Model name**: `line_follower`
- **Enable cloud build**: Yes
- **Register module**: Yes

[nits] Some of these are capitalized in the CLI prompts anyway, plus regardless it looks odd in the list for them to be inconsistent

Comment on lines +341 to +342
Find the [Part ID](/dev/reference/apis/fleet/#find-part-id) for your machine.
To deploy your module on your machine, run the following command, replacing `<your-part-id>` with your Part ID:
Copy link
Contributor

@JessamyT JessamyT Jul 23, 2025

Choose a reason for hiding this comment

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

Suggested change
Find the [Part ID](/dev/reference/apis/fleet/#find-part-id) for your machine.
To deploy your module on your machine, run the following command, replacing `<your-part-id>` with your Part ID:
Find the [part ID](/dev/reference/apis/fleet/#find-part-id) for your machine.
To deploy your module on your machine, run the following command, replacing `<your-part-id>` with your part ID:

[nit]

Comment on lines +322 to +336
# Register your module
Registry.register_resource_creator(
LineFollower.MODEL,
ResourceCreatorRegistration(LineFollower.new_resource, LineFollower.validate)
)

async def main():
"""
Main entry point for the Viam module.
"""
await Module.serve()

if __name__ == "__main__":
asyncio.run(main())
LineFollower.LOGGER.info("Done.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry if this is a silly question but, the module generator doesn't include this--why is it here? You're not using easyresource?

I worry this will contribute to the chatbot mixing and matching example module structures

Comment on lines +251 to +255
async def start(self):
LineFollower.LOGGER.info("Starting color following...")
await self._start_color_following_internal()

async def close(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

When do these get called? I noticed they're not generated by the generator for generic service. I see we have close here https://python.viam.dev/autoapi/viam/services/generic/client/index.html#viam.services.generic.client.GenericClient.close but not start


## Follow a line

This module uses a vision service and a motor to program a machine to follow a line of a configurable color.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This module uses a vision service and a motor to program a machine to follow a line of a configurable color.
This module uses a vision service to make a mobile robot follow a colored line.
You can configure the color.

It doesn't just use a motor

@JessamyT
Copy link
Contributor

Also nit: make sure your PR title is in imperative mood

Comment on lines +312 to +318
if location == "left":
# Crop logic for left side
pass
elif location == "right":
# Crop logic for right side
pass
# Implement detection logic here
Copy link
Contributor

Choose a reason for hiding this comment

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

Did not review all the code in this PR because was first curious about overall intent of PR, but if this does go forward this code will need to be fixed

@npentrel npentrel closed this Jul 31, 2025
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.

4 participants