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

choi woo young's profile - activity

2018-01-28 05:07:25 -0500 received badge  Famous Question (source)
2017-05-19 08:20:07 -0500 received badge  Famous Question (source)
2014-10-10 08:58:42 -0500 received badge  Popular Question (source)
2014-10-10 08:58:42 -0500 received badge  Notable Question (source)
2014-06-08 11:35:43 -0500 received badge  Notable Question (source)
2014-02-08 04:06:03 -0500 received badge  Popular Question (source)
2013-11-22 03:36:25 -0500 asked a question irobot_create bumper

Hello, i am going to use bumper with Turtlebot1

Although i ran the source as below, i couldn't run the callback function. Why?


#!/usr/bin/env python    
import roslib; roslib.load_manifest('enclosure_escape')    
import rospy   
from geometry_msgs.msg import Twist    
from create_node.msg import TurtlebotSensorState

bump = False

def callback(TurtlebotSensorState):    
   global bump   
   bump = TurtlebotSensorState.bumps_wheeldrops > 0       
def hello_create():    
   pub = rospy.Publisher('mobile_base/commands/velocity', Twist)    
   rospy.Subscriber('/create_node/sensor_state', TurtlebotSensorState, callback)    
   rospy.init_node('hello_create')    
   global bump    
   twist = Twist()

   while not rospy.is_shutdown():    
       if bump:   
           rospy.loginfo("bump")    
           twist.linear.x = 0; twist.linear.y = 0; twist.linear.z = 0   
           twist.angular.x = 0; twist.angular.y = 0; twist.angular.z = 0    
           bump = False    
       else:
           rospy.loginfo("go")    
           twist.linear.x = 0.1; twist.linear.y = 0; twist.linear.z = 0    
           twist.angular.x = 0; twist.angular.y = 0; twist.angular.z = 0.1    
       pub.publish(twist)    
       rospy.sleep(0.25)

if __name__ == '__main__':    
   try:    
       hello_create()    
   except rospy.ROSInterruptException: pass
2013-11-20 22:29:47 -0500 asked a question turtlrbot1 bumper

Hello, i am going to use bumper with Turtlebot1

Although i ran the source as below, i couldn't run the callback function. Why?


#!/usr/bin/env python    
import roslib; roslib.load_manifest('enclosure_escape')    
import rospy   
from geometry_msgs.msg import Twist    
from create_node.msg import TurtlebotSensorState

bump = False

def callback(TurtlebotSensorState):    
   global bump   
   bump = TurtlebotSensorState.bumps_wheeldrops > 0       
def hello_create():    
   pub = rospy.Publisher('mobile_base/commands/velocity', Twist)    
   rospy.Subscriber('/create_node/sensor_state', TurtlebotSensorState, callback)    
   rospy.init_node('hello_create')    
   global bump    
   twist = Twist()

   while not rospy.is_shutdown():    
       if bump:   
           rospy.loginfo("bump")    
           twist.linear.x = 0; twist.linear.y = 0; twist.linear.z = 0   
           twist.angular.x = 0; twist.angular.y = 0; twist.angular.z = 0    
           bump = False    
       else:
           rospy.loginfo("go")    
           twist.linear.x = 0.1; twist.linear.y = 0; twist.linear.z = 0    
           twist.angular.x = 0; twist.angular.y = 0; twist.angular.z = 0.1    
       pub.publish(twist)    
       rospy.sleep(0.25)

if __name__ == '__main__':    
   try:    
       hello_create()    
   except rospy.ROSInterruptException: pass
2013-11-20 21:32:11 -0500 received badge  Editor (source)
2013-11-20 21:25:47 -0500 asked a question turtlebot1 bumper T_T

Bumper sensor is not working.. why??

#!/usr/bin/env python import roslib; roslib.load_manifest('create_node') import rospy from geometry_msgs.msg import Twist from create_node.msg import TurtlebotSensorState

global variables

bump = False

listen (adapted from line_follower

def processSensing(TurtlebotSensorState): global bump bump = TurtlebotSensorState.bumps_wheeldrops > 0 #newInfo = True

def hello_create(): pub = rospy.Publisher('mobile_base/commands/velocity', Twist) rospy.Subscriber('/create_node/sensor_state', TurtlebotSensorState, processSensing) rospy.init_node('hello_create') #listen global bump twist = Twist() while not rospy.is_shutdown(): if bump: str = "hello create, you have bumped into something %s"%rospy.get_time() rospy.loginfo(str) twist.linear.x = 0; twist.linear.y = 0; twist.linear.z = 0 twist.angular.x = 0; twist.angular.y = 0; twist.angular.z = 0 bump = False else: str = "hello create, you can spin now %s"%rospy.get_time() rospy.loginfo(str) twist.linear.x = 0.1; twist.linear.y = 0; twist.linear.z = 0 twist.angular.x = 0; twist.angular.y = 0; twist.angular.z = 0.1 pub.publish(twist) rospy.sleep(0.25) if __name__ == '__main__': try: hello_create() except rospy.ROSInterruptException: pass