CMU 15494 Cognitive Robotics - motion_commands (35 pages)

Previewing pages 1, 2, 16, 17, 18, 34, 35 of 35 page document View the full content.
View Full Document

motion_commands



Previewing pages 1, 2, 16, 17, 18, 34, 35 of actual document.

View the full content.
View Full Document
View Full Document

motion_commands

85 views

Other


Pages:
35
School:
Carnegie Mellon University
Course:
15494 Cognitive Robotics -

Unformatted text preview:

Motion Commands and Real Time Programming 15 494 Cognitive Robotics David S Touretzky Ethan Tira Thompson Carnegie Mellon Spring 2008 01 26 08 15 494 Cognitive Robotics 1 Motion Commands Live in Shared Memory 01 26 08 15 494 Cognitive Robotics 2 Motion Commands Are Objects A MotionCommand is an object with 2 kinds of methods 1 Command methods for telling it what you want it to do Called by user code running in Main 2 An updateOutputs method for computing new effector values joint angles LED brightness etc 01 26 08 Called every 32 ms by the motion manager running in Motion 15 494 Cognitive Robotics 3 Types of Motion Commands Red outline means this class has subclasses 01 26 08 15 494 Cognitive Robotics 4 Creating a Motion Command SharedObject LedMC leds mc The actual LedMC object is created in shared memory The SharedObject named leds mc lives in Main s address space and holds a pointer to the shared memory region Two ways to refer to a motion command within Main 01 26 08 via the shared object via the MC ID Motion Command ID assigned to it by the Motion Manager motman when the motion command is active 15 494 Cognitive Robotics 5 LedMC Defined in Motion LedMC h LedMC inherits from two parent classes MotionCommand updateOutputs isAlive is this command active isDirty have outputs changed LedEngine 01 26 08 cycle cycle these LEDs sine wave pattern flash flash these LEDs for n msecs then end invert invert the status of these LEDs etc 15 494 Cognitive Robotics 6 LedEngine cycle LEDBitmask t bitmask unsigned int period float amplitude float offset 0 int phase 0 period 5000 ms amplitude 1 period 5000 ms amplitude 5 offset 1 period 2000 ms amplitude 200 01 26 08 15 494 Cognitive Robotics 7 Sample LedMC Program include Behaviors BehaviorBase h include Motion LedMC h include Motion MotionManager h class DstBehavior public BehaviorBase protected MotionManager MC ID leds id id of MotionCommand public DstBehavior BehaviorBase DstBehavior leds id MotionManager invalid MC ID 01 26



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view motion_commands and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view motion_commands and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?