Skip to content

Latest commit

 

History

History
187 lines (161 loc) · 4.02 KB

README.md

File metadata and controls

187 lines (161 loc) · 4.02 KB

B-Pro, AD, RC3, Mechatronics Workshop

  • This Repo has been created for Skill's Module for Bartlett AD, UCL. It contains Dynamixel SDK from https://github.com/ROBOTIS-GIT/DynamixelSDK.
  • Scripts are modified for robotis ax-12a servos.
  • It contains control pipeline from Unity to pi, controlling dynamixel servos via udp protocol.

Prerequisite

  • python 3
  • dynamixel sdk
  • python-osc (python 3)
  • unity3d
  • pip3

Material

  • Raspberry pi
  • Robotis Dynamixel AX_12A
  • U2D2
  • SMPS2Dynamixel
  • 12V DC Adaptor
  • Micro USB cable
  • Micro USB (female) cable (if using pi zero)

Unity

  • type address pattern and servoid + "#" + value (eg. "writeGoalPos" and "1#720")

Additional Resources

Raspberry pi - additional resources for sensors

Linux Terminal Cheat Sheet

  • run commands with administrative privileges(run as admin in Windows)
sudo
  • used for installing or upgrading packages
apt-get
#or
sudo apt-get install
sudo apt-get upgrade
  • ge help
--help
  • List all files in the current folder
ls
  • Change directory
cd /  # to root directory
cd -  # to previous directory
cd .. # to one up directory
cd ~  # to home directory
  • print working directory
pwd
  • copy
cp
cp exampleCode.py /home/workshop # would copy the file “exampleCode.py” to the directory “/home/workshop”)
  • move
mv
mv exampleCode.py /home/workshop # would move the file “exampleCode.py” to the directory “/home/workshop”
  • remove
rmdir # removes an empty directory 
rm -r # removes a directory recursively (!!!try not to use this line!!!)
rm exampleCode.py #delete a single file in current folder
rm -rf home/worshop/ # delete all files in this folder
rmd # permanantly delete file
  • make directory
mkdir
  • edit script on pi
nano filename
nano exampleCode.py
  • to logout from pi
logout
  • to see usb connected
lsusb
  • to see connected device port address
ls /dev/tty*

Using Git on Pi

  • clone a repo
git clone <url>.git
  • install git
sudo apt-get install git
  • configuring github
git config --global user.name "user_name"

git config --global user.email "email_id"
  • initialize git
git init
  • git on existing repo (origin)
git remote add origin <repourl>.git
  • add files
git add .
  • commit changes
git commit -m "short text about changes"
  • push changes
git push -u origin master

# if more than one branch
git push -all
  • pull changes
git fetch

git stash

git merge origin/master

FTP

  • you may also use FTP or SFTP with Cyberduck

In case U2D2 is not recognized

  • download Dynamixel Wizard to double check the id and baudrate of servo
  • check the port name from device manager(in Windows)
  • if not visible in the device manager download ftdi driver
  • In Linux
ls /dev/tty* # generally its /dev/ttyUSB0
# or
lsusb # to check how many driver is plugged

In case your laptop can not recieve udp message

  • check the Firewall settings in Windows and make a new inbound rule