Ask Your Question
1

Motor controller support for dual channels (Roboteq SDC2130)

asked 2014-05-19 00:30:08 -0500

eve gravatar image

updated 2014-05-19 00:31:09 -0500

I'm using the Roboteq SDC2130 Motor Controller and using the ros-hydro-roboteq-driver package and supporting packages (i.e. msgs and diagnostics) to control my motor controller. The package only supports one channel and I'm trying to have ROS support two channels (SDC2130 is a dual channel controller). Before I create a new catkin package of ros-hydro-roboteq-driver and edit the package (I don't want to edit this in /opt/ros/hydro), I was wondering if I'm missing an obvious way to access both channels. (?)

Currently I'm planning to output something like:

rostopic pub -1 (roboteq_cmd_topic) (topic_type) -- (output for Motor 1) (output for Motor 2)

To do this, I'll have to change <topic type=""> from float32 to float32[] (MultiArray), but it seems like I'll have to edit the driver code too. I'd hate to have missed an obvious solution to this, if someone is aware of the solution, please steer me in the right direction. Also if there is a better alternative to the editing the code, I'd really appreciate your advise. I'm new to ROS (2 weeks) and trying to expose myself to it with hardware that I have.

edit retag flag offensive close merge delete

Comments

If your catkin workspace space is before /opt/ros/hydro in the ROS_PACKAGE_PATH variable, you can git clone the ros-hydro-roboteq-driver package in your catkin workspace and it will be use instead of the /opt/ros/hydro one ;). Helpful trick if you want to work on its code without changing the /opt.

Maya gravatar image Maya  ( 2014-05-19 00:37:35 -0500 )edit

Thanks for the response maya, thats exactly what I'm planning to do. I'm using this reference http://answers.ros.org/question/9197/for-new-package-downloading/ to git clone to my ~/catkin_ws/src/. Ofcourse I'll have to edit it for hydro. Good to know I'm heading the right way :)

eve gravatar image eve  ( 2014-05-19 00:48:53 -0500 )edit

Isn't your package already made to work with catkin ? If yes, you just need to git clone it in your workspace and it should work.

Maya gravatar image Maya  ( 2014-05-19 02:21:29 -0500 )edit

I sure did! I tried to debug it in my eclipse IDE but I couldnt run the node. I get the error Invalid node name [~]. I have managed to access both channels thanks to ahendrix though! :)

eve gravatar image eve  ( 2014-05-20 03:03:35 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2014-05-19 05:20:06 -0500

ahendrix gravatar image

From reading the code, it looks like the roboteq driver already supports multiple named channels through the channels parameter.

Try running it with something like:

rosrun roboteq_driver roboteq_driver_node _channels:='[ "left", "right" ]'

Note that the channels parameter is an array of names for the channels, so you may have to play with the syntax a bit to get it right.

edit flag offensive delete link more

Comments

I had something similar first, but I still could control the controller. Instead of passing channel arguments through rosrun, I edited the roslaunch files but only channel 1 (left motor) would respond to commands and not not channel 2. Turns out, I also had to replace the microbasic hex files from my windows pc Roboteq+ Software as the script configures the motor controller and channel 2 was not configured.

eve gravatar image eve  ( 2014-05-20 02:52:54 -0500 )edit

I hadn't tried the rosrun method (I get the error: Invalid node name [~]). but I saved it to my roslaunch files adding this extra line: <rosparam param="channels">['left', 'right']</rosparam> However, if someone did want to pass channels paramters through roslaunch, I believe the syntax would be _channels:="['left', 'right'}"

eve gravatar image eve  ( 2014-05-20 02:58:36 -0500 )edit

Thanks for help ahendrix, I really appreciate it! :)

eve gravatar image eve  ( 2014-05-20 03:01:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-05-19 00:30:08 -0500

Seen: 1,020 times

Last updated: May 19 '14