Client script not getting executed

I have my server program working correctly when i manually call it, but when I am using a client program to call the service after the server is launched the BB8 robot wont move an inch. It does seem that the BB8 robot wobbles a little like its about to move. At first I felt it had to do something with the execution speed but I am not sure. Please help:

#! /usr/bin/env python

import rospy
from services_quiz.srv import BB8CustomServiceMessage, BB8CustomServiceMessageRequest



var = rospy.ServiceProxy(’/move_bb8_in_square_custom’, BB8CustomServiceMessage)

obj = BB8CustomServiceMessageRequest()

obj.side = 6.0
obj.repetitions = 8

result = var(obj)

Hi @mamojiz97 ,

Your code logic seems to be correct. [Although, you need to give your variables a descriptive name. Avoid using foo, bar, var, obj… etc]

Have you tried reloading the simulation and then calling the server with the client?

Does the node name match in the launch file exactly?
In your code it is client_Call_service, but is the node in your launch file named client_call_service. Is there any case-mismatch ?



@girishkumar.kannan Thank you for the reply. I will keep that in mind regarding variables.
As to reloading the simulation, yes I have tried the same and couldn’t fix the issue. Also yes, the node names for the script file and launch file are the same as well.
Both launch files are executed properly yet the issue remains.

@girishkumar.kannan It worked! I did not find anything different in the node names in either files but I tried changing names for both and it worked. Only if I had done this earlier. Thank you for instigating the idea and your help.

1 Like

@mamojiz97 ,

Glad to know I was of some help!
Which brings me to this point: make sure to not use any node name that is already in use.
I believe a better fix would have been using:
rospy.init_node("your_node_name", anonymous=True).


1 Like

This topic was automatically closed after 3 days. New replies are no longer allowed.