Package edu.tufts.hrilab.nao
Interface NaoInterface
- All Superinterfaces:
SpeechProductionInterface
,VelocityInterface
- All Known Subinterfaces:
MockNaoInterface
- All Known Implementing Classes:
MockNaoComponent
,NaoComponent
,NaoWizardComponent
The
NaoComponent
interface.-
Method Summary
Modifier and TypeMethodDescriptionvoid
angleInterpolation
(String name, float angle, float time, boolean isAbsolute) Move NAO joint to a particular angle.void
angleInterpolation
(List<String> names, List<Float> angles, float time, boolean isAbsolute) Move NAO joints to a particular angle.void
Move NAO joints to a particular angle.boolean
blink()
boolean
Checks if there is floor support in front of the robot.boolean
Checks if there is an obstacle in front of the robot.boolean
Closes the handfloat
Get NAO joint angle.javax.vecmath.Point3d
getPixelPositionInRobotFrame
(int pX, int pY, int width, int height, int camID) Computes position of pixel in robot frame.Get current posture.Get list of all possible postures.boolean
goToPosture
(String targetPosture) Move into specified posture.boolean
isMoving()
Query whether or not robot is moving.boolean
boolean
boolean
moveTo
(float x, float y, float theta) Makes the robot move to the given pose in the ground plane, relative to FRAME_ROBOT.boolean
moveToBlocking
(float x, float y, float theta) Makes the robot move to the given pose in the ground plane, relative to FRAME_ROBOT.boolean
Opens the handvoid
Play the specified audio fileboolean
pointHeadTo
(float x, float y, float z) Points head to the (x,y,z) location in the robot's base coordinate frame.boolean
pointTo
(float x, float y, float z) Points to the (x,y,z) location in the robot's base coordinate frame.boolean
rest()
Puts the nao in the rest position, relaxing all motors.boolean
Rests robot's left/right arm by placing thr hands on its lap and turning the motors off.boolean
boolean
sayAnimated
(String annotatedText) boolean
Perform text-to-speech on input text.boolean
To save tts output to file instead of saying it outloud.boolean
setBreathEnabled
(String par, boolean enable) boolean
setStiffness
(String name, float stiffness) Sets joint/actuator stiffnessboolean
welcome()
Methods inherited from interface edu.tufts.hrilab.interfaces.SpeechProductionInterface
isSpeaking, sayText, stopUtterance
Methods inherited from interface edu.tufts.hrilab.interfaces.VelocityInterface
getDefaultVels, getRV, getTV, getVels, setRV, setTV, setVels, stop
-
Method Details
-
isMoving
boolean isMoving()Query whether or not robot is moving.- Returns:
-
playFile
Play the specified audio file- Parameters:
fileName
- : the path of the file to play
-
goToPosture
Move into specified posture.- Parameters:
targetPosture
-- Returns:
-
moveTo
boolean moveTo(float x, float y, float theta) Makes the robot move to the given pose in the ground plane, relative to FRAME_ROBOT. This is a not a blocking call. TODO: this needs to be generalized into a DIARC interface so that it's not specific to the nao component.- Parameters:
x
- Distance along the X axis in meters.y
- Distance along the Y axis in meters.theta
- Rotation around the Z axis in radians [-3.1415 to 3.1415].- Returns:
-
moveToBlocking
boolean moveToBlocking(float x, float y, float theta) Makes the robot move to the given pose in the ground plane, relative to FRAME_ROBOT. This is a blocking call. TODO: this needs to be generalized into a DIARC interface so that it's not specific to the nao component.- Parameters:
x
- Distance along the X axis in meters.y
- Distance along the Y axis in meters.theta
- Rotation around the Z axis in radians [-3.1415 to 3.1415].- Returns:
-
angleInterpolation
Move NAO joint to a particular angle.- Parameters:
name
- - joint name to moveangle
- -time
- - how long to take to move to desired joint angleisAbsolute
-
-
angleInterpolation
void angleInterpolation(List<String> names, List<Float> angles, List<Float> times, boolean isAbsolute) Move NAO joints to a particular angle. A different time values can be used for each joint.- Parameters:
names
- - joint name to moveangles
- - angles for jointstimes
- - how long to take to move to desired joint anglesisAbsolute
-
-
angleInterpolation
Move NAO joints to a particular angle. A single time value is used for all joints.- Parameters:
names
- - joint name to moveangles
- - angles for jointstime
- - how long to take to move to desired joint anglesisAbsolute
-
-
getAngle
Get NAO joint angle.- Parameters:
name
- - joint name- Returns:
-
pointTo
boolean pointTo(float x, float y, float z) Points to the (x,y,z) location in the robot's base coordinate frame. Units are in meters.- Parameters:
x
-y
-z
-- Returns:
-
restLeftArm
boolean restLeftArm()Rests robot's left/right arm by placing thr hands on its lap and turning the motors off. Takes 1500ms to complete (blocking). Also disables hip motors!!!- Returns:
-
restRightArm
boolean restRightArm() -
pointHeadTo
boolean pointHeadTo(float x, float y, float z) Points head to the (x,y,z) location in the robot's base coordinate frame. Units are in meters.- Parameters:
x
-y
-z
-- Returns:
-
checkFloorSupport
boolean checkFloorSupport()Checks if there is floor support in front of the robot. TODO: this needs to be generalized into a DIARC interface so that it's not specific to the nao component.- Returns:
- true if it's safe to move forward, false otherwise
-
checkObstacle
boolean checkObstacle()Checks if there is an obstacle in front of the robot. TODO: this needs to be generalized into a DIARC interface so that it's not specific to the nao component.- Returns:
- true if it's safe to move forward, false otherwise
-
getPosture
String getPosture()Get current posture.- Returns:
-
getPostureList
Get list of all possible postures.- Returns:
-
sayText
Perform text-to-speech on input text.- Specified by:
sayText
in interfaceSpeechProductionInterface
- Parameters:
text
-- Returns:
-
sayToFile
To save tts output to file instead of saying it outloud.- Parameters:
text
-filename
-- Returns:
-
setStiffness
Sets joint/actuator stiffness- Parameters:
name
- Name of joint/actuator. See nao doc.stiffness
- Value between 0 and 1- Returns:
-
rest
boolean rest()Puts the nao in the rest position, relaxing all motors.- Returns:
-
openHand
Opens the hand- Parameters:
name
- Name of joint/actuator (LHand or RHand).- Returns:
-
closeHand
Closes the hand- Parameters:
name
- Name of joint/actuator (LHand or RHand).- Returns:
-
getPixelPositionInRobotFrame
javax.vecmath.Point3d getPixelPositionInRobotFrame(int pX, int pY, int width, int height, int camID) Computes position of pixel in robot frame.- Parameters:
pX
- x position of pixelpY
- y position of pixelwidth
- Width of imageheight
- Height of imagecamID
- Camera ID (0 [top], 1 [bottom])- Returns:
- Position of pixel projected on floor/table.
-
sayAnimated
-
welcome
boolean welcome() -
setBreathEnabled
-
ledOn
-
ledOff
-
blink
boolean blink()
-