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

How do I use or find documentation for robotiq_ft_sensor_acc numerical commands?

asked 2019-01-25 16:15:53 -0500

mosslab gravatar image

updated 2019-01-25 21:48:08 -0500

I'm using the kinetic-devel branch of the robotiq package and noticed that in the comments of rq_sensor.cpp, a "New interface with numerical commands" is mentioned in the receiverCallback function. Until now I've been unaware of these, as they don't seem to be mentioned anywhere except in the pull requests of the jade-devel branch of this package, which reference some old string-based commands like "SET ZRO". I am interested in using whatever the equivalent of "SET ZRO" is now to zero out my FT300 sensor before using its readings.

After some digging I've learned I need to use rosservice call robotiq_ft_sensor_acc [command_id] [command], but as for what [command_id] and [command] should be, other than an integer and string respectively, I have no clue. I have tried every combination of numbers and strings but the service always returns success: False and either res: !!binary | followed by some random short string of characters, or res:''. Also, occasionally the terminal running rq_sensor gives me a warning saying that I should use a numeric command instead of a string, something which the service doesn't seem to actually allow. It doesn't give this warning if I retry the same command a second time.

I'm very new to ROS so pardon me if this is a stupid question, but what commands are appropriate for this service? Or, where can I find documentation that tells me how robotiq_ft_sensor_acc is supposed to work?


edit retag flag offensive close merge delete


Can you please update your question with a link to the package that you are referring to?

jayess gravatar image jayess  ( 2019-01-25 17:49:21 -0500 )edit

Yes! I've added everything I could find.

mosslab gravatar image mosslab  ( 2019-01-25 21:49:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-01-27 03:19:57 -0500

gvdhoorn gravatar image

updated 2019-01-27 03:25:45 -0500

Afaict, the constants to use with that service are -- as is often the case -- documented in the service definition itself (this one):

uint8 command_id
string command  # deprecated, please use command_id with a value of COMMAND_*
bool success
string res

So legal values would seem to be: 1, 2, 4 and 8, corresponding to GET_SERIAL_NUMBER, GET_FIRMWARE_VERSION, GET_PRODUCTION_YEAR and SET_ZERO respectively.

The value of command_id is used in this switch to call the corresponding function.

I am interested in using whatever the equivalent of "SET ZRO" is now to zero out my FT300 sensor before using its readings.

I'm not a Robotiq user myself, but iiuc, you'd have to use the value corresponding to COMMAND_SET_ZERO (ie: 8) for that.

After some digging I've learned I need to use rosservice call robotiq_ft_sensor_acc [command_id] [command], [..]

As it's deprecated, you'd probably leave command (ie: the string field) empty.

And note that if you'd write a (short Python) service client, you'd actually use the constant name, not the value it maps to directly. See robotiq_ft_sensor/nodes/rq_test_sensor.cpp for a C++ example of how that would work.

Edit: the contants are also mentioned in the documentation of the rq_state_get_command(..) function.

That is all non-user-facing documentation though, so it would have been nice if this change had received a bit more attention -- perhaps in the form of an announcement somewhere in a Robotiq support/information channel.

edit flag offensive delete link more


Thank you. I tried using those constants to no avail, and I'm pretty sure leaving the string field blank gave me another error, but I will try again on Monday and let you know what happens.

mosslab gravatar image mosslab  ( 2019-01-27 11:49:09 -0500 )edit

I got a "not enough arguments" error by just passing 8 with no string.

mosslab gravatar image mosslab  ( 2019-01-31 13:22:02 -0500 )edit

Can you please edit your original post to show the exact command line you're trying to use? "no string" is not the same as "an empty string".

gvdhoorn gravatar image gvdhoorn  ( 2019-01-31 13:29:59 -0500 )edit

Oh my gosh, I hadn't tried passing 8 "". That worked! Thank you!

mosslab gravatar image mosslab  ( 2019-01-31 16:31:10 -0500 )edit

@mosslab Wow, I was stuck for almost an hour on this, (8, "") really worked, would have never came up with this by myself, thanks!

praxidike74 gravatar image praxidike74  ( 2019-03-04 06:52:50 -0500 )edit

The thing is: using the 8 "" notation as arguments to rosservice call is only possible because rosservice provides that convenience.

If you'd tab-complete the rosservice call, you'd see that there are a nr of fields that need to be provided and they'll even be assigned their default ..

gvdhoorn gravatar image gvdhoorn  ( 2019-03-04 06:54:25 -0500 )edit

.. values. For string fields, that would be an empty string (ie: "").

I would say that doing that would have made it immediately clear that those two arguments must be provided.

gvdhoorn gravatar image gvdhoorn  ( 2019-03-04 06:55:04 -0500 )edit

Question Tools

1 follower


Asked: 2019-01-25 16:15:53 -0500

Seen: 199 times

Last updated: Jan 27 '19