Changing parameters with Python
Hi
I am trying to change 1 parameter on the launch of my scripts to avoid doing this every time before launching it. The parameter I am trying to change is the "SYSID_MYGCS" which has to be 1.
My current code is:
rospy.wait_for_service('/mavros/param/set')
try:
change_mode = rospy.ServiceProxy('/mavros/param/set', SetMode)
resp = change_mode("SYSID_MYGCS", 1)
print "setmode send ok %s" % resp.success
except rospy.ServiceException, e:
print "Failed SetMode: %s" % e
but it says "Failed SetMode: unable to connect to service: remote error reported: client wants service /mavros/param/set to have md5sum 48ecf639e39052f8856a839dcddf826a, but it has c423cafb898fff374cbe8530ecd4d285. Dropping connection."
I am also not sure if the code is correct because I can't find any decent tutorial for python for changing parameters. The AddInts tutorial on ROS isn't able to help me in this case. My geuss is that my code is incorrect. Does anyone know what the correct way is to change the parameter through Python?
Many thanks in advance!