Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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: 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.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 [/r_arm_ely_position_controller/command] type [std_msgs/Float64] with master
[rospy.registration][INFO] 2012-10-31 23:34:54,167: Registering publisher topic [/r_arm_elx_position_controller/command] type [std_msgs/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[/r_arm_elx_position_controller/command] adding connection to [/gazebo], count 0
[rospy.internal][INFO] 2012-10-31 23:34:54,386: topic[/r_arm_ely_position_controller/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
    serialize_message(b, self.seq, message)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/msg.py", line 152, in serialize_message
    msg.serialize(b)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/std_msgs/msg/_Float64.py", line 52, in serialize
    except struct.error as se: self._check_types(se)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/genpy/message.py", line 313, in _check_types
    raise SerializationError(str(exc))
SerializationError: required argument is not a float

[rospy.core][INFO] 2012-10-31 23:35:32,744: signal_shutdown [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[/r_arm_ely_position_controller/command] removing connection to /gazebo
[rospy.internal][INFO] 2012-10-31 23:35:32,747: topic[/r_arm_elx_position_controller/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/tcpros_base.py", line 658, in receive_once
    recv_buff(sock, b, p.buff_size)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 108, in recv_buff
    d = sock.recv(buff_size)
error: [Errno 104] Connection reset by peer

[rospy.client][INFO] 2012-10-31 23:39:40,422: init_node, name[/joint_control], 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 [/r_arm_ely_position_controller/command] type [std_msgs/Float64] with master
[rospy.registration][INFO] 2012-10-31 23:39:40,428: Registering publisher topic [/r_arm_elx_position_controller/command] type [std_msgs/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[/r_arm_ely_position_controller/command] adding connection to [/gazebo], count 0
[rospy.internal][INFO] 2012-10-31 23:39:40,646: topic[/r_arm_elx_position_controller/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/tcpros_base.py", line 513, in connect
    self.read_header()
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 579, in read_header
    self._validate_header(read_ros_handshake_header(sock, self.read_buff, self.protocol.buff_size))
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 543, in _validate_header
    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/tcpros_base.py", line 513, in connect
    self.read_header()
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 579, in read_header
    self._validate_header(read_ros_handshake_header(sock, self.read_buff, self.protocol.buff_size))
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 543, in _validate_header
    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/tcpros_base.py", line 513, in connect
    self.read_header()
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 579, in read_header
    self._validate_header(read_ros_handshake_header(sock, self.read_buff, self.protocol.buff_size))
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 543, in _validate_header
    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/tcpros_base.py", line 511, in connect
    self.socket.connect((dest_addr, dest_port))
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 111] Connection refused