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

Using nao_leds to blink LEDs

asked 2014-02-24 22:06:44 -0500

dnth gravatar image

I cant seem to blink the leds on Nao using nao_leds. Does anyone knows how do I do it? I dont seem to really get the action goal stuff. Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-02-24 22:24:01 -0500

dnth gravatar image

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'
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-02-24 22:06:44 -0500

Seen: 244 times

Last updated: Feb 24 '14