User Tools

Site Tools


lego_nxt_teleoperation_introduction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
lego_nxt_teleoperation_introduction [2024/08/04 15:30] – created hhameedlego_nxt_teleoperation_introduction [2024/08/15 23:30] (current) – Build Instruction Links hhameed
Line 1: Line 1:
 +<fs xx-large>**LEGO NXT Teleoperation Introduction**</fs>
 +\\
 +**Author: **Hashim H., Email: hameeh1@unlv.nevada.edu
 +\\
 +**Date: **Last modified on [08/04/24]
 +\\
 +**Keywords: **NXT, Teleoperation
 +
 <fs x-large>**Motivation and Audience**</fs> <fs x-large>**Motivation and Audience**</fs>
  
 The following tutorial has the motivation of education on teleoperation using the Lego NXT module using readily available peripherals. This tutorial assumes: The following tutorial has the motivation of education on teleoperation using the Lego NXT module using readily available peripherals. This tutorial assumes:
  
-  Unordered List ItemBricxCC (Bricx Command Center) application setup +<fc blue> 
-  * Unordered List ItemA basic understanding of C++ (or general object oriented programming)+  *BricxCC (Bricx Command Center) application setup 
 +\\ 
 +  *basic understanding of C++ (or general object oriented programming) 
 +</fc>
  
 <fs x-large>**Parts List and Sources**</fs> <fs x-large>**Parts List and Sources**</fs>
Line 13: Line 24:
  
 <fs x-large>**Software**</fs> <fs x-large>**Software**</fs>
- +\\ 
-  * [[BricxCC]] +  * [[http://sourceforge.net/projects/bricxcc/files/bricxcc|BricxCC]] 
-  * (If needed) [[NXT USB Driver]] +  * (If needed) [[https://www.daslhub.org/unlv/courses/me425-625/lesson-B-simpleMachines1-leversShaftsAndCranks/lab/NXT_USB_Driver_120.zip|NXT USB Driver]] 
-  * (If needed) [[NXC Firmware]]+  * (If needed) [[https://www.daslhub.org/unlv/courses/me425-625/lesson-B-simpleMachines1-leversShaftsAndCranks/lab/lms_arm_nbcnxc_131.rfw|NXC Firmware]]
  
 <fs x-large>**Setup**</fs> <fs x-large>**Setup**</fs>
Line 30: Line 41:
 **Step 3** **Step 3**
  
-Download the required NXC library and sample/demo on the controller product page listed above or here. It is highly recommended that you compile and run the included sample to understand how to interface with the library. +Download the required NXC library and sample/demo on the controller product page listed above or [[http://www.mindsensors.com/index.php?controller=attachment&id_attachment=39|here]]. It is highly recommended that you compile and run the included sample to understand how to interface with the library.
  
  
Line 37: Line 48:
 In any file using the PS2 library, always import the library file and define/instantiate related variables such as the module address (for communication), sensor port, and controller stat/pressure variables. In any file using the PS2 library, always import the library file and define/instantiate related variables such as the module address (for communication), sensor port, and controller stat/pressure variables.
  
-The following is an example of moving a motor connected to port A based on the input of the PS2 controller’s left stick:+{{:nxt_controller_motor.jpg?400|}}
  
-<code c basic_movement.nxc>+The following is an example of moving a motor connected to port A based (pictured above) on the input of the PS2 controller’s left stick: 
 + 
 +[[http://www.mindsensors.com/index.php?controller=attachment&id_attachment=39 | Library Download]] 
 + 
 +<code c [enable_line_numbers="true"basic_movement.nxc>
 //imports the library //imports the library
 #include "PSP-Nx-v4-lib.nxc" #include "PSP-Nx-v4-lib.nxc"
Line 72: Line 87:
 </code> </code>
  
-Given verification of user input given controller output, robotic teleoperation can be performed by building out the module with two motors in a manner similar to the domabot’s base (full instructions here) and determining output based on controller input. +Given verification of user input given controller output, robotic teleoperation can be performed by building out the module with two motors in a manner similar to the domabot’s base (full instructions [[https://www.damienkee.com/storage/domabot_build.pdf|here]]) and determining output based on controller input. 
  
-The following are examples of functions to use in your main loop for teleoperation (assuming motors connected to ports B and C):+{{:nxt_controller_drive.jpg?400|}} 
 +[[https://youtu.be/hLN8Q94Waso | Video Example]]
  
-<code c drive_functions.nxc>+The following are examples of functions to use in your main loop for teleoperation (assuming motors connected to ports B and C [pictured above]): 
 + 
 +<code c [enable_line_numbers="true"drive_functions.nxc>
 //Pass in the current state of a given joystick axis to the respective field(s) //Pass in the current state of a given joystick axis to the respective field(s)
 void tankDrive(int rightStickY, int leftStickY){ void tankDrive(int rightStickY, int leftStickY){
Line 94: Line 112:
 The following are example functions that may be used and adjusted based on peripheral construction and purpose: The following are example functions that may be used and adjusted based on peripheral construction and purpose:
  
-<code c peripheral_functions.nxc>+<code c [enable_line_numbers="true"peripheral_functions.nxc>
 //Rotates a motor forward and backward using the square button //Rotates a motor forward and backward using the square button
 //Can be used in mechanisms such as a gripper/claw and projectile “kicker” //Can be used in mechanisms such as a gripper/claw and projectile “kicker”
 //Fill variable “pressures.square” into respective field //Fill variable “pressures.square” into respective field
-//Boolean variables "closed" and "valid" are instantiated outside of function as doing so within while loop resets the respective states each iteration+ 
 +//Boolean variables "closed" and "valid" are instantiated outside of function  
 +//as doing so within while loop resets the respective states each iteration
  
 bool closed; bool closed;
Line 136: Line 156:
 } }
 </code> </code>
 +
 +**<fs x-large>Additional Build Instructions</fs>** 
 +
 +The following are links to various mobile robot builds and mechanisms to be customized for your teleoperational purposes:
 +
 +[[https://www.lego.com/cdn/product-assets/product.bi.core.pdf/4556207.pdf|Castor Bot & Kick Mechanism]]
 +\\
 +[[https://www.nxtprograms.com/game_control_car/steps.html|Elevated Castor Robot]]
 +\\
 +[[https://www.nxtprograms.com/claw_car/steps.html|Claw Mechanism]]
 +\\
 +{{ :band-powered.pdf |"Band-Powered"}}
 +\\
 +{{ :coralle_and_kick.pdf |Corrale & Kick}}
 +
 +
 +<fs x-large>**Final Words**</fs>
 +
 +The purpose of this tutorial has been to inform of the potential for teleoperation using the Lego NXT module, a user utilizing a remote controller to execute defined functions which while explained for mechanical use, may extent far beyond such. 
 +
 +Speculating future work derived from this tutorial includes that of autonomous NXT module operation with an emphasis on function execution in response to visual data.
lego_nxt_teleoperation_introduction.1722810629.txt.gz · Last modified: by hhameed