Closed irvinmarceloc closed 2 years ago
Hi @irvinmarceloc ,
Thanks for reaching out!
Are you able to turn the motors without the JetBot software?
If so do you mind sharing the code to do so, and I could provide more detail guidance on how to implement your own Robot class.
Best, John
Hey Hello. If I can spin the motors with an arduino. The code that I am using is the one that comes in the image of the operating system for jetbot in its latest version. It would be this basic move code. https://github.com/NVIDIA-AI-IOT/jetbot/blob/master/notebooks/basic_motion/basic_motion.ipynb Which is in the repository. From jupyter notebook I execute step by step and when I execute from jetbot import Robot that is where the problem is generated. Greetings. I attach the code.
_BasicMotion Welcome to JetBot's browser based programming interface! This document is called a Jupyter Notebook, which combines text, code, and graphic display all in one! Pretty neat, huh? If you're unfamiliar with Jupyter we suggest clicking the Help drop down menu in the top toolbar. This has useful references for programming with Jupyter.
In this notebook, we'll cover the basics of controlling JetBot.
Importing the Robot class To get started programming JetBot, we'll need to import the Robot class. This class allows us to easily control the robot's motors! This is contained in the jetbot package.
If you're new to Python, a package is essentially a folder containing code files. These code files are called modules.
To import the Robot class, highlight the cell below and press ctrl + enter or the play icon above. This will execute the code contained in the cell
from jetbot import Robot Now that we've imported the Robot class we can initialize the class instance as follows.
bot = bot() commanding the robot Now that we've created our Robot instance we named "robot", we can use this instance to control the robot. To make the robot spin counterclockwise at 30% of it's max speed we can call the following
WARNING: This next command will make the robot move! Please make sure the robot has clearance.
robot.left(speed=0.3)_
I simply installed the OS for jetbot in its latest version and made the following connections
@irvinmarceloc
Are you able to detect the address of the PCA9685 using i2c detect? I ask this because you're having a Remote I/O error
.
If you have never done this before. Just open terminal and install the i2c tool and use the second command to see if the address shows up.
sudo apt-get install i2c-tools
i2cdetect -y 1
If it shows up:
If it does not show up:
If it appears at address 27. Right now I don't have the jetson handy because it's in my workplace. But the address that appears is 27.
I would suggest trying to move the motor without using the jetbot code first. The jetbot library relies on the user using the adafruit motor controller because it was built using the adafruit's driver software. This is why a lot of the errors say Adafruit_PureIO-1.1.8-py3.6.egg/Adafruit_PureIO/...
.
(Other option) If you have it working with an Arduino, then you can always use i2c from the jetson to the Arduino to issue it commands to move.
https://dronebotworkshop.com/i2c-arduino-raspberry-pi/
This is a raspberry pi tutorial but i2c works the same for the Jetson.
Buenas tardes, I actually gave up on that attempt. I think I'm going to buy the controller that it indicates in the list. Thank you so much for everything
Hi guys. I am trying to use an H-bridge on the jetbot however when running the basic moves notebook I get the following error. What modifications do I have to make to be able to use an H-bridge?
OSErrorTraceback (most recent call last)