======================================================================
  RTComponent: RefHardRh2 specificatioin

  OpenRTM-aist-1.0.0
  Date: $Date$

  @author N.Takekawa (takekawa-777@aist.go.jp)

  Copyright (c) 2008, National Institute of Advanced Industrial Science and Tec
  hnology (AIST). All rights reserved. This program is made available under the te
  rms of the Eclipse Public License v1.0 which accompanies this distribution, and 
  is available at http://www.eclipse.org/legal/epl-v10.html

  This file is generated by rtc-template with the following argments.

#   rtc-template -bcxx --module-name=RefHardRh2 
#   --module-desc='RefHard VelocutyVersion RH2' --module-version=4.0.0 --module-vendor=AIST INVENT 
#   --module-category=Motor --module-comp-type=STATIC 
#   --module-act-type=PERIODIC --module-max-inst=10 
#   --config=DeviceFileName:std::string:/dev/ttyUSB0 --config=gain_P:int:10 --config=gain_I:int:0 --config=gain_D:int:0 --config=gain_VP:int:50 --config=gain_VI:int:0 --config=gain_VD:int:0 --config=Velocity_limit:double:10.0 --config=Acceleration_limit:double:50.0 --config=WheelTread:double:0.441 --config=WheelRadiusLeft:double:0.1 --config=WheelRadiusRight:double:0.1 --config=GearRatio:double:66.22 --config=EncoderCount:int:2000 --config=EncoderConstant_L:double:1.0 --config=EncoderConstant_R:double:1.0 
#   --inport=InTargetVelocity:IIS::TimedVelocity --outport=OutWheelAngle:TimedDoubleSeq 
#   --service-idl=/tmp/OpenINVENT-4.0.0/RefHard2_VelocityVersion_ver4.0.0/RefHardRh2Pro.idl 
#   --service=BumpProv:BumpRefHard:RefHard 
#   --service=InventGUIProv:InventGUIRefHard:RefHard 


======================================================================
    Basic Information
======================================================================
# <rtc-template block="module">
Module Name: RefHardRh2
Description: RefHard VelocutyVersion RH2
Version:     4.0.0
Vendor:      AIST INVENT
Category:    Motor
Kind:        DataFlowComponent
Comp. Type:  STATIC
Act. Type:   PERIODIC
MAX Inst.:   10
Lang:        C++
Lang Type:   

Overview:    Control of RH2
In/Out:      in : Velocity  out : WheelAngle
Algorithm:   -
# </rtc-template>


======================================================================
    Activity definition
======================================================================

[on_initialize]    implemented
	Description:   The device port is opened
	PreCondition:  none
	PostCondition: none

[on_finalize]

[on_startup]

[on_shutdown]      implemented
	Description:   close of device port
	PreCondition:  none
	PostCondition: none

[on_activated]     implemented
	Description:   Initialization of data
	PreCondition:  none
	PostCondition: none

[on_deactivated]   implemented
	Description:   Driving stop
	PreCondition:  none
	PostCondition: none

[on_execute]       implemented
	Description:   The speed instruction is transmitted to the motor
	PreCondition:  none
	PostCondition: none

[on_aborting]

[on_error]

[on_reset]

[on_state_update]

[on_rate_changed]

======================================================================
    InPorts definition
======================================================================
# <rtc-template block="inport">

	Name:        InTargetVelocity
	PortNumber:  0
	Description: target Trans/Rot Velocity of robot's center data for PD control
	PortType: 
	DataType:    IIS::TimedVelocity
	MaxOut: 
	[Data Elements]
		Name:
		Type:            Trans/Rot velocity data: double,    timeStamp:tm
		Number:          Trans velocity data:2, Rot velocity data:1,  timeStamp:1
		Semantics:       target Trans/Rot Velocity of robot's center data for PD con
		                 trol
		                   [Trans Velocity]: translational velocity  of robot's center [m/sec]
		                   [Rot Velocity]: rotation velocity (swing velocity) of robot's center [rad/sec]
		Unit:            Trans velocity [m/s],  Rot velocity [rad/s],  timeStamp: [s
		                 ec],[nanosec]
		Frequency:       
		Operation Cycle: 
		RangeLow:
		RangeHigh:
		DefaultValue:


# </rtc-template>

======================================================================
    OutPorts definition
======================================================================
# <rtc-template block="outport">

	Name:        OutWheelAngle
	PortNumber:  0
	Description: Wheel angle
	PortType: 
	DataType:    TimedDoubleSeq
	MaxOut: 
	[Data Elements]
		Name:
		Type:            angle data: double,    timeStamp:tm
		Number:          angle data:2,  timeStamp:1
		Semantics:       current Wheel Angle data for PD control
		                  [0]: left wheel's current data
		                  [1]: right wheel's current data
		Unit:            angle data : [rad],  timeStamp: [sec],[nanosec]
		Frequency:       
		Operation Cycle: 
		RangeLow:
		RangeHigh:
		DefaultValue:


# </rtc-template>


======================================================================
    Service Port definition
======================================================================
# <rtc-template block="serviceport">
	PortName:    BumpProv
	Description: Driving stop by Bump detection
	Interface:   Driving stop by Bump detection
		[Service Provider Interfaces]
		Name:          BumpRefHard
		Type:          RefHard
		Description:   Driving stop by Bump detection
		Argument:      void
		Return Value:  void
		Exception:     
		PreCondition:  
		PostCondition: 
	PortName:    InventGUIProv
	Description: Instruction of driving restart
	Interface:   Instruction of driving restart
		[Service Provider Interfaces]
		Name:          InventGUIRefHard
		Type:          RefHard
		Description:   driving restart
		Argument:      Go(), Stop()
		Return Value:  void
		Exception:     
		PreCondition:  
		PostCondition: 
# </rtc-template> 

======================================================================
    Configuration definition
======================================================================
# <rtc-template block="configuration">
	Configuration:
		Name:            DeviceFileName DeviceFileName
		Description:     device file name
		Type:            std::string
		DefaultValue:    /dev/ttyUSB0 /dev/ttyUSB0
		Unit:            -
		Range:           -
		Constraint:      -

		Name:            gain_P gain_P
		Description:     servo motor parameter [gain_P]
		Type:            int
		DefaultValue:    10 10
		Unit:            -
		Range:           
		Constraint:      -

		Name:            gain_I gain_I
		Description:     servo motor parameter [gain_I]
		Type:            int
		DefaultValue:    0 0
		Unit:            -
		Range:           
		Constraint:      -

		Name:            gain_D gain_D
		Description:     servo motor parameter [gain_D]
		Type:            int
		DefaultValue:    0 0
		Unit:            -
		Range:           
		Constraint:      -

		Name:            gain_VP gain_VP
		Description:     servo motor parameter [gain_VP]
		Type:            int
		DefaultValue:    50 50
		Unit:            -
		Range:           
		Constraint:      -

		Name:            gain_VI gain_VI
		Description:     servo motor parameter [gain_VI]
		Type:            int
		DefaultValue:    0 0
		Unit:            -
		Range:           
		Constraint:      -

		Name:            gain_VD gain_VD
		Description:     servo motor parameter [gain_VD]
		Type:            int
		DefaultValue:    0 0
		Unit:            -
		Range:           
		Constraint:      -

		Name:            Velocity_limit Velocity_limit
		Description:     servo motor parameter [veloc_limit]
		Type:            double
		DefaultValue:    10.0 10.0
		Unit:            [m/s]
		Range:           
		Constraint:      -

		Name:            Acceleration_limit Acceleration_limit
		Description:     Value in which acceleration limitation is done
		Type:            double
		DefaultValue:    50.0 50.0
		Unit:            [m/s^2]
		Range:           
		Constraint:      -

		Name:            WheelTread WheelTread
		Description:     Length of axle
		Type:            double
		DefaultValue:    0.441 0.441
		Unit:            [m]
		Range:           
		Constraint:      -

		Name:            WheelRadiusLeft WheelRadiusLeft
		Description:     Radius of Wheel(Left)
		Type:            double
		DefaultValue:    0.1 0.1
		Unit:            [m]
		Range:           
		Constraint:      -

		Name:            WheelRadiusRight WheelRadiusRight
		Description:     Radius of Wheel(Right)
		Type:            double
		DefaultValue:    0.1 0.1
		Unit:            [m]
		Range:           
		Constraint:      -

		Name:            GearRatio GearRatio
		Description:     gear ratio
		Type:            double
		DefaultValue:    66.22 66.22
		Unit:            -
		Range:           
		Constraint:      -

		Name:            EncoderCount EncoderCount
		Description:     encoder count
		Type:            int
		DefaultValue:    2000 2000
		Unit:            -
		Range:           
		Constraint:      -

		Name:            EncoderConstant_L EncoderConstant_L
		Description:     Encoder Constant [L]
		Type:            double
		DefaultValue:    1.0 1.0
		Unit:            -
		Range:           
		Constraint:      -

		Name:            EncoderConstant_R EncoderConstant_R
		Description:     Encoder Constant [R]
		Type:            double
		DefaultValue:    1.0 1.0
		Unit:            -
		Range:           
		Constraint:      -

# </rtc-template> 
This area is reserved for future OpenRTM.

