Skip to content

Episode 4. Bring Your Code with Python SDK (Part 2)

Play the tutorial

In this tutorial you will:

  • create custom nodes with Python
  • learn how to implement a callback function with the Python SDK
  • how to let Intrepid AI orchestrate Python nodes and other logic

How to Run a Python node

Explore the examples from the official Intrepid Python SDK repository

You can execute any existing Python node from the examples with something like

python my_code_tutorial_2_vel.py

Publish Python node

In order to publish a node from the SDK to your Intrepid profile, you need the Intrepid Agent and a token that you can copy from the Project section on the dashboard (You can also revoke tokens from your Settings -> Security section).

The command below will publish a node called node/sdk/tutorial-another-vel; such node is executed on 127.0.0.1:9999. The https link contains the token generated from the Project section on dashboard.

./intrepid-agent --load ws://127.0.0.1:9999 publish node/sdk/tutorial-another-vel https://labs.intrepid.ai/projects/21/rmhkw2...dWR

At this point, the node should be available in your node library under the name tutorial-another-vel and can be inserted and connected to the other nodes of your graphs.

Simulate graph (calling your Python node)

If your graph contains nodes that do not require a simulator (Controller nodes do require a simulator to be executed), you can simply run the graph with the intrepid-agent.

In this specific case, the graph contains nodes that make sense only to a simualator (and/or the real robotic vehicle). Running the graph with the intrepid-agent would not be sufficient. We need to run intrepid-sim.

./intrepid-sim --load ws://127.0.0.1:9999 https://labs.intrepid.ai/projects/21/tpPUXZ...ITM

If you want to generate a world to run your simulation in, you can add --citygen and generate buildings, trees and other urban assets, to create a world in which the simulation will be performed

The command above will become

./intrepid-sim --load ws://127.0.0.1:9999 https://labs.intrepid.ai/projects/21/tpPUX...ITM --citygen

Connect with Intrepid AI

Join Us on Discord

Connect with the team on Discord

Intrepid Newsletter

Subscribe for free and never miss a beat Subscribe