using rosserial for interfacing to BLDC controller

asked 2018-06-03 01:39:01 -0500

simbawave gravatar image

hi all,

after googling alot, and really confusing, finally i found rosserial package which is my best bet to go for building my first robot from the scratch using ROS. link: http://wiki.ros.org/rosserial

my NUC now installed with ubuntu 18.04. i'm considering to install ROS kinetic or melodic coz i'm really new to this field. probably i will go with kinetic coz roboware provide a nice IDE for a beginner like me.

my basic problem, i'm sorry if i'm asking this very basic and old fashioned question: is my choice for using rosserial package correct to interface the BLDC controller to drive the motors?

i have 1 BLDC controller, 24/48V, 50A, dual channel, support CANopen and RS232 through USB. the fty gave me the PDF files for CANopen protocol and RS232, so i understand for command A will result a reply or result a specific action (such as !p 1 10000 will produce motor channel 1 move forward CW 10,000 ticks. the motor is 200W BLDC with 2500PPR optical encoder).

that's very promising for a beginner as that protocol enable an idiot like me to drive the motor using shell/bash script by accessing the port, sending text command, and read the string reply if any.

so what should i do next to jump with ROS? modifying rosserial? or writing all those commands in somewhere? or using socketcan? or worst, i have to go through hard way, using serial (not rosserial) and create a HW driver for ros?

please kindly give me a clue or guide which steps i should go. many thx in advance

edit retag flag offensive close merge delete

Comments

1

rosserial is not a generic library for accessing serial ports, but a package that provides a set of nodes for running a "ros transport" over a serial connection (or something similarly low-bandwidth). You cannot send/receive arbitrary data with/through it.

gvdhoorn gravatar imagegvdhoorn ( 2018-06-03 05:18:12 -0500 )edit

thx for giving me a clue. so, kick out the rosserial. what options do i have now to start with ROS? in this case, to make ROS able to talk to my controller? where should i write all those RS232 or CANopen commands so ROS can use all those commands to talk with the controller?

simbawave gravatar imagesimbawave ( 2018-06-03 07:06:15 -0500 )edit

I don't believe the task is to "make ROS talk to my controller". ROS only provides you with a way to communicate between programs using standardised msgs (ie: semantics). The rest is all standard C/C++/Java/Python/whatever. It is important to realise that.

gvdhoorn gravatar imagegvdhoorn ( 2018-06-03 13:04:42 -0500 )edit

serial might be an option.

But again: it's only going to take care of shuffling bytes out of a serial port and allowing you to read them out of one.

The rest is up to you -- unless someone has already implemented a lib for the serial protocol you're using.

gvdhoorn gravatar imagegvdhoorn ( 2018-06-03 13:05:36 -0500 )edit

then? for a beginner like me, rosserial? let's say i have the protocols, both RS232 and CANopen. is it rosserial is the way to go for me?

coz i think the protocols or the set of commands is the only way for talking between PC to controller before making the motor spinning. and ROS is a software.

simbawave gravatar imagesimbawave ( 2018-06-03 13:35:26 -0500 )edit

so either rosserial, or any other way, is required to make my PC talk to the controller using ROS. but so far as i see, only rosserial :-lol i wish i know any other options. but i'm sure none has created ROS driver for this controller before.

simbawave gravatar imagesimbawave ( 2018-06-03 13:38:06 -0500 )edit

serial, not rosserial. Check the link I posted.

Which protocol to use would depend on your experience. If you know how Canopen works, use that.

re: ROS driver: forget ROS for now. First figure out how to communicate with the controller, then wrap that in a ROS node.

gvdhoorn gravatar imagegvdhoorn ( 2018-06-03 13:54:31 -0500 )edit

ah. thx alot for giving me a clear path to start. so far i only have this in my mind: plug everything to usb port :-lol. so i will go with serial and write all the RS232 commands using serial.at least i can rest in peace for knowing i'm in the correct path to make this funny bot running with ROS

simbawave gravatar imagesimbawave ( 2018-06-03 14:07:57 -0500 )edit