Kinovarobotics / Kinova-kortex2_Gen3_G3L

Code examples and API documentation for KINOVA® KORTEX™ robotic arms
https://www.kinovarobotics.com/
Other
117 stars 87 forks source link

RefreshCommand method return unsuported method. #105

Closed btabia closed 2 years ago

btabia commented 2 years ago

Description

One paragraph to explain the issue

Version

At a minimum, provide the Kortex API and Kortex-enabled device versions.

KortexAPI :

Kortex Device :

Steps to reproduce

When calling the method base_cyclic->refreshCommand(base_command,0) ; the system return the following message:

Error sub-code: UNSUPPORTED_METHOD Kortex exception: Server protocol error, Error sub type=UNSUPPORTED_METHOD => <srv: 3, fct: 2, msgType: 3>

Code example

void KinovaRobot::sendCommand() { auto frame_id = base_command->frame_id() + 1; base_command->set_frame_id(frame_id); if (frame_id > 65535) base_command->set_frame_id(0);

Eigen7f position = get_pose();

auto torque_offset = getTorqueOffset(); auto torque_command = getCommand();

for (unsigned int i = 0; i < KinovaRobot::actuator_count; i++) { base_command->mutable_actuators(i)->set_command_id(frame_id); base_command->mutable_actuators(i)->set_position(position(i)); base_command->mutable_actuators(i)->set_torque_joint(torque_command(i)); }

base_cyclic->RefreshCommand(*base_command,0);

}

felixmaisonneuve commented 2 years ago

Hi @btabia,

I usually get this type of error when using the wrong version of the API and/or the wrong firmware version. Both needs to be at 2.3

To check your arm's firmware version, you can do it in the webapp in Systems->Upgrade (Firmware Bundle) image

For your API's version, you can check it using pip : pip3 show kortex-api

Best, Felix

btabia commented 2 years ago

Both my firmware and my the kortex api are in version 2.3 and I still have the problem

conan_cmake_run(REQUIRES kortex_api_cpp/2.3.0-r.34@kortex/stable SETTINGS kortex_api_cpp:compiler=gcc SETTINGS kortex_api_cpp:compiler.version=5 SETTINGS compiler.libcxx=libstdc++11 PROFILE_AUTO build_type BASIC_SETUP UPDATE)

Screenshot from 2022-04-12 09-48-44

felixmaisonneuve commented 2 years ago

Ok, I think this is because you have a typo in your function so the arm does not recognise the command your are sending try RefreshCommand instead of refreshCommand

Best, Felix

felixmaisonneuve commented 2 years ago

Hi @btabia,

I will assume this has solved the problem and close this issue since I didn't ear from you. If you still have a problem, you can re-open it or leave a comment and I will be glad to assist you.

Best, Felix