Class: MINT::Head

Inherits:
Body show all
Defined in:
lib/MINT-core/model/ir/body/head.rb

Defined Under Namespace

Classes: StatefulProtocol

Constant Summary

Constants inherited from Interactor

Interactor::PUBLISH_ATTRIBUTES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Interactor

class_from_channel_name, #create_attribute_channel_name, create_channel_name, #create_channel_w_name, get, getModel, get_dm, #init_statemachine, #is_in?, #new_states, notify, #process_event, #process_event!, #process_event_vars, #publish_update, #states, #states=, #sync_event, #sync_states, #to_dot, wait

Methods included from InteractorHelpers

#restart_timeout, #start_timeout, #stop_timeout

Constructor Details

#initialize(attributes = nil) ⇒ Head

Returns a new instance of Head.



16
17
18
# File 'lib/MINT-core/model/ir/body/head.rb', line 16

def initialize(attributes = nil)
  super(attributes)
end

Instance Attribute Details

#connectionObject

Returns the value of attribute connection.



4
5
6
# File 'lib/MINT-core/model/ir/body/head.rb', line 4

def connection
  @connection
end

Instance Method Details

#consume_head_movement(consume = true) ⇒ Object



35
36
37
38
# File 'lib/MINT-core/model/ir/body/head.rb', line 35

def consume_head_movement(consume = true)
  @connection.consume_head_movement = consume
  [@head_x,@head_y, @head_scale, @hand_angle]
end

#consume_nose_movement(consume = true) ⇒ Object



31
32
33
# File 'lib/MINT-core/model/ir/body/head.rb', line 31

def consume_nose_movement(consume = true)
  @connection.consume_nose_movement = consume
end

#getSCXMLObject



12
13
14
# File 'lib/MINT-core/model/ir/body/head.rb', line 12

def getSCXML
  "#{File.dirname(__FILE__)}/head.scxml"
end

#start(host = "0.0.0.0", port = 4242) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/MINT-core/model/ir/body/head.rb', line 20

def start(host ="0.0.0.0", port=4242)
  EventMachine::start_server host, port, StatefulProtocol do |conn|
    @connection = conn

    conn.head = self
    puts "connection..."
    self.process_event :connect
  end
  puts "Started head control server on #{host}:#{port}"
end