Robotics StackExchange | Archived questions

Unable to take manual input for the joints

(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: initnode, name[/jointcontrol], 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 [/rarmelypositioncontroller/command] type [stdmsgs/Float64] with master
[rospy.registration][INFO] 2012-10-28 16:41:16,915: Registering publisher topic [/rarmelxpositioncontroller/command] type [stdmsgs/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[/rarmelypositioncontroller/command] adding connection to [/gazebo], count 0
[rospy.internal][INFO] 2012-10-28 16:41:17,234: topic[/rarmelxpositioncontroller/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: signalshutdown [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[/rarmelypositioncontroller/command] removing connection to /gazebo
[rospy.internal][INFO] 2012-10-28 16:42:13,094: topic[/rarmelxpositioncontroller/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: signalshutdown [atexit]
[rospy.client][INFO] 2012-10-31 23:34:54,148: initnode, name[/jointcontrol], 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.registration][INFO] 2012-10-31 23:34:54,165: Registering with master node http://localhost:11311
[xmlrpc][INFO] 2012-10-31 23:34:54,165: xml rpc node: starting XML-RPC server
[rospy.registration][INFO] 2012-10-31 23:34:54,165: Registering publisher topic [/rarmelypositioncontroller/command] type [stdmsgs/Float64] with master
[rospy.registration][INFO] 2012-10-31 23:34:54,167: Registering publisher topic [/rarmelxpositioncontroller/command] type [stdmsgs/Float64] with master
[rospy.init][INFO] 2012-10-31 23:34:54,265: registered with master
[rospy.rosout][INFO] 2012-10-31 23:34:54,265: initializing /rosout core topic
[rospy.rosout][INFO] 2012-10-31 23:34:54,267: connected to core topic /rosout
[rospy.simtime][INFO] 2012-10-31 23:34:54,268: initializing /clock core topic
[rospy.simtime][INFO] 2012-10-31 23:34:54,270: connected to core topic /clock
[rospy.internal][INFO] 2012-10-31 23:34:54,284: topic[/clock] adding connection to [unknown], count 0
[rospy.internal][INFO] 2012-10-31 23:34:54,386: topic[/rarmelxpositioncontroller/command] adding connection to [/gazebo], count 0
[rospy.internal][INFO] 2012-10-31 23:34:54,386: topic[/rarmelypositioncontroller/command] adding connection to [/gazebo], count 0
[rospy.internal][INFO] 2012-10-31 23:34:54,551: topic[/rosout] adding connection to [/rosout], count 0
[rospy.topics][ERROR] 2012-10-31 23:35:32,706: Traceback (most recent call last):
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/topics.py", line 792, in publish
    self.impl.publish(data)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/topics.py", line 968, in publish
    serializemessage(b, self.seq, message)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/msg.py", line 152, in serializemessage
    msg.serialize(b)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/stdmsgs/msg/Float64.py", line 52, in serialize
    except struct.error as se: self.checktypes(se)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/genpy/message.py", line 313, in _checktypes
    raise SerializationError(str(exc))
SerializationError: required argument is not a float

[rospy.core][INFO] 2012-10-31 23:35:32,744: signalshutdown [atexit] [rospy.internal][INFO] 2012-10-31 23:35:32,747: topic[/rosout] removing connection to /rosout [rospy.internal][INFO] 2012-10-31 23:35:32,747: topic[/rarmelypositioncontroller/command] removing connection to /gazebo [rospy.internal][INFO] 2012-10-31 23:35:32,747: topic[/rarmelxpositioncontroller/command] removing connection to /gazebo [rospy.internal][INFO] 2012-10-31 23:35:32,747: topic[/clock] removing connection to http://sudip:34992/ [rospy.impl.masterslave][INFO] 2012-10-31 23:35:32,748: atexit [rospy.internal][ERROR] 2012-10-31 23:35:32,748: Traceback (most recent call last): File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 658, in receiveonce recvbuff(sock, b, p.buffsize) File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 108, in recvbuff d = sock.recv(buffsize) error: [Errno 104] Connection reset by peer

[rospy.client][INFO] 2012-10-31 23:39:40,422: initnode, name[/jointcontrol], pid[11015] [xmlrpc][INFO] 2012-10-31 23:39:40,422: XML-RPC server binding to 0.0.0.0 [xmlrpc][INFO] 2012-10-31 23:39:40,424: Started XML-RPC server [http://sudip:51485/] [rospy.init][INFO] 2012-10-31 23:39:40,424: ROS Slave URI: [http://sudip:51485/] [rospy.impl.masterslave][INFO] 2012-10-31 23:39:40,424: ready: http://sudip:51485/ [rospy.registration][INFO] 2012-10-31 23:39:40,425: Registering with master node http://localhost:11311 [xmlrpc][INFO] 2012-10-31 23:39:40,425: xml rpc node: starting XML-RPC server [rospy.registration][INFO] 2012-10-31 23:39:40,425: Registering publisher topic [/rarmelypositioncontroller/command] type [stdmsgs/Float64] with master [rospy.registration][INFO] 2012-10-31 23:39:40,428: Registering publisher topic [/rarmelxpositioncontroller/command] type [stdmsgs/Float64] with master [rospy.init][INFO] 2012-10-31 23:39:40,524: registered with master [rospy.rosout][INFO] 2012-10-31 23:39:40,525: initializing /rosout core topic [rospy.rosout][INFO] 2012-10-31 23:39:40,527: connected to core topic /rosout [rospy.simtime][INFO] 2012-10-31 23:39:40,528: initializing /clock core topic [rospy.simtime][INFO] 2012-10-31 23:39:40,530: connected to core topic /clock [rospy.internal][INFO] 2012-10-31 23:39:40,545: topic[/clock] adding connection to [http://sudip:34992/], count 0 [rospy.internal][INFO] 2012-10-31 23:39:40,645: topic[/rarmelypositioncontroller/command] adding connection to [/gazebo], count 0 [rospy.internal][INFO] 2012-10-31 23:39:40,646: topic[/rarmelxpositioncontroller/command] adding connection to [/gazebo], count 0 [rospy.internal][INFO] 2012-10-31 23:39:40,733: topic[/rosout] adding connection to [/rosout], count 0 [rospy.internal][ERROR] 2012-10-31 23:40:20,080: Unable to initiate TCP/IP socket to sudip:46691 (http://sudip:34992/): Traceback (most recent call last): File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 513, in connect self.readheader() File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 579, in readheader self.validateheader(readroshandshakeheader(sock, self.readbuff, self.protocol.buffsize)) File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 543, in _validateheader raise TransportInitError("remote error reported: %s"%header['error']) TransportInitError: remote error reported: received a connection for a nonexistent topic [/clock] from [TCPROS connection to [127.0.0.1:43065 on socket 16]] [/joint_control].

[rospy.internal][ERROR] 2012-10-31 23:40:21,083: Unable to initiate TCP/IP socket to sudip:46691 (http://sudip:34992/): Traceback (most recent call last): File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 513, in connect self.readheader() File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 579, in readheader self.validateheader(readroshandshakeheader(sock, self.readbuff, self.protocol.buffsize)) File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 543, in validateheader raise TransportInitError("remote error reported: %s"%header['error']) TransportInitError: remote error reported: received a connection for a nonexistent topic [/clock] from [TCPROS connection to [127.0.0.1:43074 on socket 16]] [/joint_control].

[rospy.internal][ERROR] 2012-10-31 23:40:23,086: Unable to initiate TCP/IP socket to sudip:46691 (http://sudip:34992/): Traceback (most recent call last): File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 513, in connect self.readheader() File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 579, in readheader self.validateheader(readroshandshakeheader(sock, self.readbuff, self.protocol.buffsize)) File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 543, in validateheader raise TransportInitError("remote error reported: %s"%header['error']) TransportInitError: remote error reported: received a connection for a nonexistent topic [/clock] from [TCPROS connection to [127.0.0.1:43078 on socket 17]] [/joint_control].

[rospy.internal][WARNING] 2012-10-31 23:40:27,091: Unknown error initiating TCP/IP socket to sudip:46691 (http://sudip:34992/): Traceback (most recent call last): File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcprosbase.py", line 511, in connect self.socket.connect((destaddr, destport)) File "/usr/lib/python2.7/socket.py", line 224, in meth return getattr(self.sock,name)(*args) error: [Errno 111] Connection refused

Asked by gerkey on 2012-11-05 21:32:45 UTC

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?

Asked by gerkey on 2012-11-05 21:42:04 UTC

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

Asked by gerkey on 2013-01-11 20:53:20 UTC

Answers