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

TELESPIELSTUBE's profile - activity

2023-02-27 03:42:54 -0500 received badge  Famous Question (source)
2021-12-13 05:48:35 -0500 received badge  Famous Question (source)
2021-07-07 21:25:07 -0500 received badge  Notable Question (source)
2021-07-07 21:25:07 -0500 received badge  Popular Question (source)
2021-06-09 10:04:59 -0500 marked best answer Pass an object to Service handler callback() function

Hello

is there a way to pass objects to a callback()? I just found this post: https://answers.ros.org/question/2314...

but if I pass the object like mentioned in the post I get this error message:

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 737, in receive_once
    self.stat_bytes += recv_buff(sock, b, p.buff_size)
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 104, in recv_buff
    d = sock.recv(buff_size)
TypeError: 'AiService' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 667, in handle
    requests = transport.receive_once()
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 758, in receive_once
    raise TransportException("receive_once[%s]: unexpected error %s"%(self.name, str(e)))
rospy.exceptions.TransportException: receive_once[/image_ack]: unexpected error 'AiService' object cannot be interpreted as an integer

My code (shortened):

def callback(request, arg):
    response = ImageAckResponse()
    ai_machine = arg[0]
    ...
    return response

def main():
    rospy.init_node('ai_service')
    ai_machine = AiMachine()
    ...
    rospy.Service('image_ack', ImageAck, callback, (ai_machine))
    rospy.spin()
2021-06-09 10:04:59 -0500 received badge  Scholar (source)
2021-06-09 10:04:57 -0500 received badge  Supporter (source)
2021-06-09 09:21:20 -0500 edited question Pass an object to Service handler callback() function

Pass an object to callback() function Hello is there a way to pass objects to a callback()? I just found this post: ht

2021-06-09 09:21:20 -0500 received badge  Editor (source)
2021-06-09 09:21:02 -0500 commented question Pass an object to Service handler callback() function

Changed the object name to ai_machine for better understanding and enclosed the object but still getting the same error

2021-06-09 09:21:01 -0500 edited question Pass an object to Service handler callback() function

Pass an object to callback() function Hello is there a way to pass objects to a callback()? I just found this post: ht

2021-06-09 08:58:04 -0500 asked a question Pass an object to Service handler callback() function

Pass an object to callback() function Hello is there a way to pass objects to a callback()? I just found this post: ht

2021-06-02 09:37:13 -0500 received badge  Notable Question (source)
2021-05-27 07:22:08 -0500 commented question Trying to send an image via ROS Service

Keep the other one and I repost my answer.

2021-05-27 05:54:17 -0500 commented question Trying to send an image via ROS Service

It is, but I actually postet from my "TELESPIELSTUBE" account and that post is closed now. I also posted an answer yeste

2021-05-27 05:53:54 -0500 answered a question Trying to send an image via ROS Service

It is, but I actually postet from my "TELESPIELSTUBE" account and that post is closed now. I also posted an answer yeste

2021-05-27 05:53:54 -0500 received badge  Rapid Responder (source)
2021-05-27 05:40:10 -0500 received badge  Popular Question (source)
2021-05-27 04:50:37 -0500 commented question Trying to send an image via ROS Service

I don't understand why this is a duplicate. I though I cannot post messages from a closed account

2021-05-26 16:04:46 -0500 asked a question Trouble sending images via ROS Service

Trouble sending images via ROS Service Hello I'm trying to send a .png via service from a service client written in C++

2021-05-26 13:24:02 -0500 received badge  Rapid Responder (source)