Unable to take manual input for the joints [closed]

asked 2012-11-05 20:32:45 -0500

gerkey gravatar image

(Forwarded from DRC Forum)

Hi,

I have modified the arm controller to take input from keyboard:

while not rospy.is_shutdown():
    varx = raw_input("Enter x: ")
    vary = raw_input("Enter y: ")
    try:
        r_arm_elx.publish(float(varx))
        r_arm_ely.publish(float(vary))
    except ValueError:
        print "Not a float"
    t = 6 * rospy.get_time()
    print t
    #Added for delay
    rospy.sleep(1)

but it crashes every now and then. Logs for the crash are attached. Should this be sent to Gazebo forum?

Kindly, help.

Thanks,

Sudip

Log:

[rospy.client][INFO] 2012-10-28 16:41:16,911: init_node, name[/joint_control], pid[8266]
[xmlrpc][INFO] 2012-10-28 16:41:16,912: XML-RPC server binding to 0.0.0.0
[xmlrpc][INFO] 2012-10-28 16:41:16,912: Started XML-RPC server [http://sudip:59937/]
[rospy.init][INFO] 2012-10-28 16:41:16,912: ROS Slave URI: [http://sudip:59937/]
[rospy.impl.masterslave][INFO] 2012-10-28 16:41:16,912: _ready: http://sudip:59937/
[xmlrpc][INFO] 2012-10-28 16:41:16,913: xml rpc node: starting XML-RPC server
[rospy.registration][INFO] 2012-10-28 16:41:16,913: Registering with master node http://localhost:11311
[rospy.registration][INFO] 2012-10-28 16:41:16,913: Registering publisher topic [/r_arm_ely_position_controller/command] type [std_msgs/Float64] with master
[rospy.registration][INFO] 2012-10-28 16:41:16,915: Registering publisher topic [/r_arm_elx_position_controller/command] type [std_msgs/Float64] with master
[rospy.init][INFO] 2012-10-28 16:41:17,013: registered with master
[rospy.rosout][INFO] 2012-10-28 16:41:17,013: initializing /rosout core topic
[rospy.rosout][INFO] 2012-10-28 16:41:17,014: connected to core topic /rosout
[rospy.simtime][INFO] 2012-10-28 16:41:17,016: initializing /clock core topic
[rospy.simtime][INFO] 2012-10-28 16:41:17,017: connected to core topic /clock
[rospy.internal][INFO] 2012-10-28 16:41:17,031: topic[/clock] adding connection to [http://sudip:50802/], count 0
[rospy.internal][INFO] 2012-10-28 16:41:17,233: topic[/r_arm_ely_position_controller/command] adding connection to [/gazebo], count 0
[rospy.internal][INFO] 2012-10-28 16:41:17,234: topic[/r_arm_elx_position_controller/command] adding connection to [/gazebo], count 0
[rospy.internal][INFO] 2012-10-28 16:41:17,277: topic[/rosout] adding connection to [/rosout], count 0
[rospy.core][INFO] 2012-10-28 16:42:13,089: signal_shutdown [signal-2]
[rospy.internal][INFO] 2012-10-28 16:42:13,093: topic[/rosout] removing connection to /rosout
[rospy.internal][INFO] 2012-10-28 16:42:13,093: topic[/r_arm_ely_position_controller/command] removing connection to /gazebo
[rospy.internal][INFO] 2012-10-28 16:42:13,094: topic[/r_arm_elx_position_controller/command] removing connection to /gazebo
[rospy.internal][INFO] 2012-10-28 16:42:13,094: topic[/clock] removing connection to http://sudip:50802/
[rospy.impl.masterslave][INFO] 2012-10-28 16:42:13,094: signal-2
[rospy.core][INFO] 2012-10-28 16:42:13,210: signal_shutdown [atexit]
[rospy.client][INFO] 2012-10-31 23:34:54,148: init_node, name[/joint_control], pid[10827]
[xmlrpc][INFO] 2012-10-31 23:34:54,164: XML-RPC server binding to 0.0.0.0
[xmlrpc][INFO] 2012-10-31 23:34:54,164: Started XML-RPC server [http://sudip:37331/]
[rospy.init][INFO] 2012-10-31 23:34:54,164: ROS Slave URI: [http://sudip:37331/]
[rospy.impl.masterslave][INFO] 2012-10-31 23:34:54,164: _ready: http://sudip:37331/
[rospy ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason not a real question by gerkey
close date 2013-01-11 19:53:37.420699

Comments

I tried to reproduce your crash and cannot. Whatever input I give, the client program continues. The log looks like a non-float value got through to publish(). But your try/except logic should prevent that from happening. Did you always have the exception logic in there?

gerkey gravatar imagegerkey ( 2012-11-05 20:42:04 -0500 )edit

Closing for lack of information. Please re-post if you can provide more details.

gerkey gravatar imagegerkey ( 2013-01-11 19:53:20 -0500 )edit