how can i let ros node communicate with external device

asked 2015-10-16 08:43:18 -0500

Huan Qiu gravatar image

Hi, everyone. I have a motor equiped with encoder. I want to get and set the value of encoder so as to control my motor via USB-CAN. the node is compiled successfully. What's more, the connection between my motor and Ubuntu is ok, which performs perfectly. However, I cannot establish the connection between ros node and my motor. How can I do?

edit retag flag offensive close merge delete

Comments

We need more information to be able to help you. What packages are you using? Do you have any sample code? Why can you not establish a connection? Do you have errors?

jarvisschultz gravatar image jarvisschultz  ( 2015-10-16 17:04:20 -0500 )edit

I do not use any packages. the node is compiled without any errors. However, when running my node, the master cannot search the gateway of my motor, so the connection can not be established. In ubuntu, the pc can get the gateway of my motor if I run the TestSDK using root.

Huan Qiu gravatar image Huan Qiu  ( 2015-10-16 20:43:58 -0500 )edit

So, I wonder whether I run my node using root. do you have some suitable packages about usb-can communication to recommend. a simple code: DWORD dwGateWayLen = SearchGateway(UIDEV_USBCAN, mDevInfoObj, 5);

the SearchGateway does not return right information.

Huan Qiu gravatar image Huan Qiu  ( 2015-10-16 20:52:38 -0500 )edit