How to run a rosservice through python?

asked 2022-07-12 11:46:39 -0500

soroushk93 gravatar image

We are controlling the robot's motion through ROS with python codes. However, we can't open and close the gripper with python codes. Still, we are able to open and close the gripper through Ubuntu's terminal with this code:

$ rosservice call /write_single_io "address: 10011 value: 1"

I was wondering if you have any suggestions that we could call the above rosservice in python. I have followed these tutorials but none of them help me:

http://wiki.ros.org/ROS/Tutorials/Usi...

https://answers.ros.org/question/2458...

http://wiki.ros.org/ROS/Tutorials/Wri...

https://www.codegrepper.com/code-exam...

If it helps:

We are using the HC10DT Yaskawa Motoman robot Ubuntu 20.04 ROS noetic The rosservice that I'm trying to call in python is /write_single_io rosservice info/wrtie_single_io submits: Node: /io_relay URI: rosrpc://PATY162-1:58655 Type: motoman_msgs/WriteSingleIO Args: address value

The /io_relay node is written in python

edit retag flag offensive close merge delete