Skip to content

Latest commit

 

History

History
 
 

example-basic-move

##Basic Move Example

######This example shows you the basics of open-loop control for a robot arm using ofxRobotArm.

screengrab

####What You'll Learn Basic Move goes over:

  • How to connect to your robot via ethernet
  • How to get your robot moving using ofxGizmo
  • Basic UI layout of ofxRobotArm

##Getting Started To get started with ofxRobotArm you first need to grab all the dependant libraries for the addon. Use the installAddons.sh script to clone all the external addons used in the examples. Also please note that these addons might depend on other external addons, so reference the README of each external addons to make sure you've got everything.

The next step is to set up your robot's ethernet connection.

Universal Robots has instructions for setting up ethernet communication in their User Manual. But they also provide a walk-thru here.

Once you have an IP address for your robot, all you should need to do is modify one line of code in example-basic-move to connect to your robot:

  • On line 40 replace the default ip address with your robot's ip address in robot.setup()

After that, run the project. You should see your robot positioned properly of the left side of the screen. Also, you should see that the Robot's FPS is running about 120fps in the lower left hand corner of the GUI. If you don't see a robot in the GUI, or if the Robot's FPS says 0, jump down to the Troubleshooting section.

##Navigating the UI The UI for ofxRobotArm is laid out in a few sections:

  • The left half holds the Simulated Robot
    • You can manaully move and reorient Simulated Robot to update your real robot
  • The right half holds the Realtime Robot
    • The Realtime Robot reads and visualizes the joint values streaming from your robot's control box
  • The top right visualizes target and actual joint values
    • This panel is really helpful for debugging when you're hitting joint limits
  • The vertical panel to the far right holds a lot of important information and settings
    1. Showing the robot's current postion & orientation
    2. Showing the robot's current speed & acceleration
    3. A panel with buttons to get, set, and move the robot's position & orientation
    4. A panel for fine tuning movements: Acceleration Multiplier, Speed Divider, Lerp Factor

screengrab

##Get Moving Here's the basic workflow for running example-basic-move:

  1. Plug in your ethernet connection between your computer and your robot, and make sure you're on the same network :)
  2. Run example-basic-move. You should see the Realtime Robot on the right of your screen in the same configuration as your actual robot IRL.
  3. On the far right panel, press get TCP to make the Simulated Robot on the left match the Realtime Robot on the right.
  4. In the same panel, press set TCP to change the position or orientation of the Simulated Robot.
    • When you press set TCP, a gizmo should pop up at the TCP of the Simulated Robot.
    • You can click and drag the axes and planes of the gizmo to move the Simulated Robot.
  5. With the Simulated Robot moving, press m to move your actual robot.
    • If the Realtime Robot isn't moving after you press m, check your Acceleration Multiplier and Speed Divider: if the Acceleration Multiplier is too low, or the Speed Divider is too high, the robot will move verrrrrry slowly.
  6. Press m again to stop sending move commands to the robot.

####Other Usage Notes We rely on hotkeys for triggering a lot of the UI functionality. Below are the hotkeys we use that work across all the example projects included in ofxRobotArm.

KeyPressed commands for controlling the robot:

  • m: move

KeyPressed commands for controlling gizmo:

  • r: rotate
  • g: translate
  • s: scale

KeyPressed commands for viewport navigation:

  • 1: Top View
  • 2: Front View
  • 3: Side View
  • 4: Perspective View