How-To

From HRB
Jump to: navigation, search

Our kit

Dynamixel modules
Cr-module.jpg Ub-module.jpg
Connectors
Bd-male-1.0.png

The design files for our modules and attached parts are here (Audodesk Inventor format): File:2016-released-design-files.zip Peter's Updated Files: File:HRB_CAD_Library.zip NOTE: these designs are NOT released into the public domain; you may only use these files for purposes of your work in the Hands On Robotics class.

Below are links to two files about the spec of the motors that we are about to use.

Rx-64.pdf

Spec sheet for mx-64
Yen-Ming Huang

Virtual Machine Setup


You will need to download VirtualBox for your OS, and also the (platform independent) Virtual Box Extensions. Also obtain a (reasonably current) Ubuntu linux VM image, e.g. from osboxes; we strongly recommend the xubuntu variant.

If you feel like the VM is slow, you can increase both RAM and processing power allocated to running the VM. To do this, make sure your VM is powered off and do the following:

  • Select the VM and click on "Options"
  • Click on "System" and change RAM to desired amount
  • Click on "Processor" and change Execution Cap to desired amount

Start up the Virtual Machine

  • Login is osboxes.org PW is osboxes.org
  • Under Devices, set "Drag and Drop" to be bidirectional
  • Download the HandsOnRobotics-net-installer.sh script from Canvas
  • Open terminal (ctrl+alt+T is the default shortcut for ubuntu distributions)
  • Now run the script with bash HandsOnRobotics-net-installer.sh. Do not run this command with sudo, you will get the following error if you do: Do not sudo or run this as root. Instead, run from your user account

It should install some keys, then download a second stage installer from our server, then install a bunch of stuff. At the end of the process, you should have the following folders in your home directory: HandsOnRobotics pyckbot python-libs.

Examples of using CKBot tools

Hex-core.jpg
Posable programming HOWTO shows how robot motions can be programmed by positioning the robot in poses and then replaying the sequence.

"Hello World" of moving modules

Here's the Hello World of programming modules directly. Use the following commands from the ipython prompt

import ckbot.logical as L
c = L.Cluster(count=1) # Insert the number of physical modules here

Now the modules are ready for use. You can see them by either using c as a python dictionary, or by using the c.at.[TAB] to get completions for the module names. Assuming there was a module with ID number 20, which is 0x14, and that this module is in servo mode, you could give the command:

c.at.Nx14.set_pos(1000)

to move the module to 10 degrees from the zero position

How to fix "[errno 13] permission denied: ... /dev/ttyS0" error:

The process is found on stackoverflow.

Type this command and then log out and back in again:

sudo adduser <username> dialout

You must also allow the VM to access the USB port by selecting USB UART at the bottom of the VirtualBox window's status bar.

Using the Snap-Ons for Servos

See attached pdf for detailed instructions

File:Using Snaplocks for mounting Servos.pdf

- Yaohui (2013)

Getting Started with the Computer Vision Software

Figure 1
Figure 2

The screen contains three terminal windows and one visualization window (figure 1).

The Java program that recognizes the tags on the corners of the arena, the waypoints, and the robot runs in the first terminal window (figure 2). To run the program, type the command ". do_TS" in the /home/ubuntu directory.

If you get the error Device or Resource Busy, or Address Already in Use, it can mean that some other program is running in the background. In order to know which programs are running you can type "jobs" and you will see the programs in background. To kill the program, type "fg" and press Ctrl-C. (Pressing Ctrl-Z puts the process in the background instead of killing the process.) Sometimes just waiting a few minutes will fix Address Already in Use, because the OS can temporarily keep sockets open after the program that opened them has completed.

If you get the error Waiting for Client Connection and the map of the arena does not appear, you can run the demo-sensor-tcp2.py client on the server. Note that only one client is allowed to connect to the server at a time, so you must close the client on the server before you can control your robot.

Now to use the data which you are getting from the webcam you have to run "waypointTask.py". You can run this independently in another terminal by using the command "execfile('waypointTask.py')" in ipython --pylab in the /home/ubuntu/2012-project-1 directory. Then a GUI pops up which tracks the position of corners, waypoints, and the robot. This command does not display the GUI unless the Java program is already running. You can now run your own program by utilizing the demo programs in the /home/ubuntu/2012-project-1 directory on the server. The sensor demo code is also available on the wiki: File:Demo-sensor-tcp2.py. Our current video tracking server is at 141.213.30.218; replace 127.0.0.1 in the code with this address. To restart the waypoint tracking, stop waypointTask.py and restart it.

Using Camera System

See Start_up_the_P1_vision_system

Using the Tether

Figure 1: Tether

The tether (Figure 1) is used as a wired connection to communicate with a robot that can be several meters away from the controlling computer. It consists of two small white boxes with RJ-45 Ethernet jacks which are connected by a 5-meter blue Ethernet cable. It is stored in a box in the EECS 498 cabinet to the right of the projection screen. One of the two connectors has red and black leads which connect to the power supply. The other connector is connected to a servo on the robot.

Using the Wixel

Figure 1: Wixel

The Wixel is a module that contains a radio transciever, and this can be used to provide wireless communication between the computer and a robot. In Figure 1, the part that connects to the computer is on the left and the part that connects to the robot is on the right. To provide power to the robot, you can use either batteries or long power cables. There may be a particular order in which to power the components of the system for the connection to work properly.

Figure 2: Wixel connected to the Dynamixel Daisy Chain

The procedure to use the Wixel to control your Dynamixel modules is as follows. First, make sure your code is on the latest version by running the command, git pull --update, from your HandsOnRobotics/pyckbot directory. Then run the following commands inside an IPython window:

from joy import *
a=JoyApp(robot=dict('/dev/ttyACM0'))
a.robot.populate()

We can now control the Dynamixel modules in by calling functions of type a.robot.at.Nx**.****().