ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is what I worked out, but something is still missing.

import roslib; roslib.load_manifest('beginner_tutorials_naotalk')
import rospy

# Brings in the SimpleActionClient
import actionlib

import std_msgs.msg
import nao_msgs.msg
from nao_msgs.msg import *


def blink_client():
    rospy.init_node("blink_client")
    client = actionlib.SimpleActionClient('blink', nao_msgs.msg.BlinkAction)
    client.wait_for_server()   
    #goal = actionlib_tutorials.msg.FibonacciGoal(colors.r=1, blink_rat_mean=1.5 ,blink_rate_sd=1.7 )
    #colors=[1,2,3,4], blink_rate_mean=1.5, blink_rate_sd=1.7
    goal=nao_msgs.msg.BlinkGoal(colors=(1,2,3,4), blink_rate_mean=1.5, blink_rate_sd=1.7)

    #BlinkGoal.colors=[1,1,1,1]
    #BlinkGoal.blink_rate_mean=1.5
    #BlinkGoal.blink_rate_sd=1.7


    client.send_goal(goal)
    client.wait_for_result()
    return client.get_result()

if __name__ == '__main__':
    try:
        rospy.init_node('blink_client')
        result = blink_client()
        print "Result:", ', '.join([str(n) for n in result.sequence])
    except rospy.ROSInterruptException:
        print "program interrupted before completion"

Below is the error message

AttributeError: 'int' object has no attribute 'r'