Difference between revisions of "ARCHR (voodoo-style controller)"

From Lofaro Lab Wiki
Jump to: navigation, search
Line 25: Line 25:
 
4: For the stereovision code, the streaming IPs must be changed to your current IP.
 
4: For the stereovision code, the streaming IPs must be changed to your current IP.
 
* Navigate to the Stereovision folder within the base ARCHR folder, and change the file paths in the startReceive and startStream.sh files as done above.
 
* Navigate to the Stereovision folder within the base ARCHR folder, and change the file paths in the startReceive and startStream.sh files as done above.
*:Try running the left.py webcam with the ID and IP correct, with a USB webcam attached to test it. It can be viewed locally with an IP of http://127.0.0.1 typed in the web browser. For more help, see the setup the streaming webcams guide [[http://wiki.lofarolabs.com/index.php/Streaming_webcams_to_Oculus_Rift_with_openCV here]]
+
* Try running the left.py webcam with the ID and IP correct, with a USB webcam attached to test it. It can be viewed locally with an IP of http://127.0.0.1 typed in the web browser. For more help, see the setup the streaming webcams guide [[http://wiki.lofarolabs.com/index.php/Streaming_webcams_to_Oculus_Rift_with_openCV here]]
  
 
==Running the code==
 
==Running the code==

Revision as of 20:45, 16 December 2014

Setting up the code

1: Download the code from the Lofarolabs Github ARCHR Baxter branch here by running this command from a terminal

$ git clone https://github.com/LofaroLabs/Baxter

2: Navigate to the location where the files were downloaded (the ARCHR folder) and edit the startController bash script using a text editor. Change the file path so that it reflects the current directory.

  • One way of doing this is:
$ cd /home/archr/projects/Baxter/ARCHR
$ gedit startController.sh
  • The lines to change will be line 9 and 11, so that if your ubuntu username is "student" and the files are located under downloads
 /home/archr/projects/Baxter/ARCHR/archr_team.jpg

becomes

 /home/student/Downloads/Baxter/ARCHR/archr_team.jpg
  • For line 16, make sure to only change the username and keep the ros_ws attached to the end.

3: Repeat this process for the controllerL, controllerR, gripperR and serverArms.sh bash files as well.

4: For the stereovision code, the streaming IPs must be changed to your current IP.

  • Navigate to the Stereovision folder within the base ARCHR folder, and change the file paths in the startReceive and startStream.sh files as done above.
  • Try running the left.py webcam with the ID and IP correct, with a USB webcam attached to test it. It can be viewed locally with an IP of http://127.0.0.1 typed in the web browser. For more help, see the setup the streaming webcams guide [here]

Running the code

Gripper
The gripper code was only setup for the right gripper because our Baxter only had one gripper. This could be easily be run twice and a few words changed to work for both.
To run the gripper code first follow the readme from the Baxter/ARCHR code above. The controllerL, controllerR, gripperR and serverArms must be copied to the ros_ws folder in the home directory. Run the startcontroller script by the command: bash startController.sh and either follow the directions on screen or continue here.
Check the terminal with the LAN and dynamixel tabs and confirm that the dyanmixels in the scaled baxter arm have been detected and that an IP was configured for your LAN connection to Baxter.
Open the other window with the ros_ws workspace loaded and confirm that they are orange (ROS environment has been loaded for Baxter)
The controllers for each arm are seperate and must be run manually but in any order desired. Running the gripper first is recommended.
Next, run the gripperR.sh script in one of these windows. If your arms claw controls the baxter gripper then you have succeeded; otherwise a calibration may be needed. Run the Baxter gripper_keyboard example and calibrate the right gripper. Then repeat this gripper script.
Run the server.sh script. Then run the controllerR.sh and controller.sh. If you can control Baxter you have succeeded congrats! Otherwise ensure you have successfully connected to the dynamixels and to Baxter.
  • To test a connection to baxter just run an example program included with the SDK and determine you can control him.


Stereovision
Navigate to the Stereovision folder and run the startStream.sh and startReceive.sh files on the streaming and receiving computers.
The head should have already been linked via the startController.sh file in the above step. However if the script scanning for dynamixels determines that the oculus sdk has been opened and then suddenly closed, please reconnect the Oculus rift headset and confirm it is streaming pitch/yaw/roll data by running the test.py script located in the Baxter/ARCHR/scripts folder. If not further debugging is required out of the scope of this guide. See the setting up Oculus dependencies guide for assistance.