How to use ros_canopen pkg?

asked 2019-03-02 07:45:56 -0500

Liudy gravatar image

updated 2019-03-02 20:24:34 -0500

HI,everybody, I'm a new guy to ROS.I have a problem on how to use ros_canopen.I have a little robot arm which have three DOF.I have seen a lot of answers on ROS answers.Now I got a USB-CAN device which produced by peak-system and I found the LINUX kernel already have the peak-usb driver, so I can use the candump and cansend now.I can get the CAN frames by using candump,so what's next. I want to know how to config the canopen_motor_node and canopen_chain_node. It looks like I need to prepare the URDF file.And I want to know how to code the controller config and driver config,I realy don't know what is controller do.It's so hard!

What I have now is 1: a USB-CAN device produced by peak-system which has peak-usb driver in linux kernel.

2: a robot arm which has three DOF and the robot arm was designed by myself. The frameless Torque Motor was bought from a unfamous manufacture.

3: three drivers which were produced by copley controls.And eds file.

4: a laptop.

What I have done is 1: I have run ROS kinetic on my laptop.And I put the ros_canopen pkg in a workspace.But when I run catkin_make I got errors: Could not find a package configuration file provided by "controller_manager_msgs",It looks like the ros_canopen pkg need to config controller pkg ,but I have never used ros_controller before.

2:I have used candump and cansend to test the CAN frames.It looks like the socketcan_interface works.

3:I have tried to control the robot arm by using DSP28335 and it works,I wrote a simple canopen program in DSP but I think the program I wrote is very bad.While I still achieved to control the robot arm using canopen in DSP.

What I want to do is using canopen to control my robot arm in ROS.In my view, if I can achieve to send or receive CAN frames, the canopen can achieve by coding protocol.That's what I tried to code in DSP28335 before. So what do I need to do next? Try to config the controller?Prepare the URDF? I am confused.

edit retag flag offensive close merge delete

Comments

Hey did you find an answer? I have the same issue with different motors and the same usb-can converter. I was reading the documentation about the api and about the stack but I still don't get the logic. If you've had a solution like a first step, like read or write an sdo could you please share it? thanks!

af.villamil231 gravatar image af.villamil231  ( 2019-04-26 09:54:21 -0500 )edit

@af.villamil231,Hi bro, I'm so sorry to reply to you so late. I have been looking for a job for a couple of months. I have solved the question in my own way, you can check it out on my github https://github.com/ldy921227/Docking_... In my view, if you can achieve to receive or send CAN data, you can achieve CANopen. So the first thing is to achieve to receive or send CAN data. The offical ros_canopen package is based on socket. If you don't know about socket, it wil be hard to use offical ros_canopen package. I have tried to realize about socket, but I still can't do it well. So I chose my own way to achieve CANopen in ROS. By reading my code on github, maybe you can get some information. If you have any questions, just ask me. I will ...(more)

Liudy gravatar image Liudy  ( 2019-12-07 05:28:07 -0500 )edit

@af.villamil231 , If you have the api about yout usb-can device, you need to check out which is used to receive or send CAN data. And the device need a drive to work in Linux. The device that I used is peak-system USB-CAN device. So you need something like a libpcan.so in your Linux. You can use the function dlopen to open libpcan.so in your program, then you can invoke the api.

Liudy gravatar image Liudy  ( 2019-12-07 05:58:54 -0500 )edit