You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

alphabot-interface

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alphabot-interface

Interface for the Alphabot sensors and camera

0.2.5
pipPyPI
Maintainers
1

AlphaBot

Version: 0.1.2
Author: @sadra-hub License: MIT
Python Version: 3.8+

Description

alphabot-interface provides a modular and simple Python interface for interacting with key components of the Waveshare AlphaBot 2 platform, including:

  • Camera module (using Picamera2)
  • Battery monitoring
  • Motor control

alphabot-interface is a lightweight Python package that lets you comfortably use various components of the AlphaBot platform and write clean, readable, and modular code.

This package is designed to abstract hardware-level interactions so developers and students can focus on high-level robotics programming and deply swarm intelligence algorithms

Installation

You can install the package via pip:

pip install alphabot-interface

Usage

This package let you comfortably use various components of AlphaBot and write clean, readable code.

from alphabot_interface import Camera, Battery, Motor

# Initialize components
camera = Camera()
battery = Battery()
motor = Motor()

target_x = 100
target_y = 0
DURATION = 3  #in seconds

# Use the motor to go to position (100,0) in 3 seconds
motor.move(target_x, target_y, DURATION)

# How much battery is left?
battery_status = battery.get_status()

# Take a photo with camera and save it to output.jpg
camera.take_picture("output.jpg")

# What do we see? 
# returns a list of {id [target or obstacle], distance, left_angle, right_angle}
camera.get_objects()

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts