0.0
No commit activity in last 3 years
No release in over 3 years
A gem providing access to Rapiro with SerialPort.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.7
~> 10.0
~> 3.1
~> 0.29.0
~> 0.9

Runtime

 Project Readme

Rapiro Wrapper

A gem providing access to Rapiro with SerialPort.

Installation

gem 'rapiro_wrapper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rapiro_wrapper

Usage1

  1. Require gem.
require 'rapiro_wrapper'
  1. Initialize commander. (default: '/dev/ttyAMA0')
rapiro = RapiroWrapper::Body.new

2.1. In another case, initialize with serial port path.

``` ruby
rapiro = RapiroWrapper::Body.new('/dev/tty.usbserial-DA00HMG6')
```
  1. Set pose.
rapiro.head  = { left:  40 }               ## param is left: 0..90 or   right: 0..90
rapiro.waist = { right: 40 }               ## param is left: 0..90 or right: 0..90
rapiro.right_sholder_roll  = { up: 120 }   ## param is up: 0..180  (default:0)
rapiro.right_sholder_pitch = { up: 20  }   ## param is hold: 0..50 or open: 0..50
rapiro.right_hand_grip     = { open: 10 }  ## param is hold: 0..50 or open: 0..50
rapiro.left_sholder_roll  = { up: 20 }     ## param is up: 0..180  (default:0)
rapiro.left_sholder_pitch = { up: 70 }     ## param is up: 0..90  (default:0)
rapiro.left_hand_grip     = { hold: 0 }    ## param is hold: 0..50 or open: 0..50
rapiro.right_foot_yaw   = { close: 10 }    ## param is close: 0..60 or open: 0..60
rapiro.right_foot_pitch = { open:  30 }    ## param is close: 0..40 or open: 0..40
rapiro.left_foot_yaw   = { open:  0 }      ## param is close: 0..60 or open: 0..60
rapiro.left_foot_pitch = { close: 0 }      ## param is close: 0..40 or open: 0..40
rapiro.eyes = '#808000'                    ## param is web color code for example #000000 or hash({red: 255, green: 255, blue: 0})
  1. Execute. (default: 10)
rapiro.execute!

4.1. In another case, execute with duration.

``` ruby
rapiro.execute!(90)  ## param is 0..127
```

Usage2

  1. Require gem.
require 'rapiro_wrapper'
  1. Initialize commander with serial port path. (default: '/dev/ttyAMA0')
commander = RapiroWrapper::Commander.new('/dev/tty.usbserial-DA00HMG6')
  1. Execute commands
## generate command sequences
sequences = [
  ## param is left: 0..90 or right: 0..90
  RapiroWrapper::Head.new( left: 30 ),

  ## param is left: 0..90 or right: 0..90
  RapiroWrapper::Waist.new( right: 30 ),

  ## param is up: 0..180  (default:0)
  RapiroWrapper::RightSholderRoll.new( up: 160 ),

  ## param is up: 0..90  (default:0)
  RapiroWrapper::RightSholderPitch.new( up: 20 ),

  ## param is hold: 0..50 or open: 0..50
  RapiroWrapper::RightHandGrip.new( hold: 0 ),

  ## param is up: 0..180  (default:0)
  RapiroWrapper::LeftSholderRoll.new( up: 30 ),

  ## param is up: 0..90  (default:0)
  RapiroWrapper::LeftSholderPitch.new( up: 20 ),

  ## param is hold: 0..50 or open: 0..50
  RapiroWrapper::LeftHandGrip.new( open: 0 ),

  ## param is close: 0..60 or open: 0..60
  RapiroWrapper::RightFootYaw.new( open: 30 ),

  ## param is close: 0..40 or open: 0..40
  RapiroWrapper::RightFootPitch.new( open: 5 ),

  ## param is close: 0..60 or open: 0..60
  RapiroWrapper::LeftFootYaw.new( close: 20 ),

  ## param is close: 0..40 or open: 0..40
  RapiroWrapper::LeftFootPitch.new( close: 0 ),

  ## param is web color code for example #000000 or hash
  RapiroWrapper::Eyes.new('#00ff00')
]
## set duration by milliseconds.  (default:10)
duration = 10
## Execute
commander.execute!(sequences, duration)
  1. Return to defaults
commander.execute!([])

Contributing

  1. Fork it ( https://github.com/tk-hamaguchi/rapiro_wrapper/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request