roboclaw icon indicating copy to clipboard operation
roboclaw copied to clipboard

Working with 2 roboclaws

Open pranavhj opened this issue 5 years ago • 1 comments

Hey, Thanks for the library, it really works well and i have been able to control 1 roboclaw quite well, I wanted to ask you how to configure the launch file roboclaw_multi.launch to work with 2 roboclaws 1 of my roboclaws is connected to port and the other one to They work when i run the roboclaw_single.launch file and enter any of the above port name, but when i go to the roboclaw_multi.launch I dont understand how do i add the second serial port address as a launch file argument....

pranavhj avatar Feb 07 '20 18:02 pranavhj

Hi,

I made it work using two roboclaws, not in the way its indicated on the readme which is using packet serial mode, that did not worked for me, but what it did worked, is that I created two launch files based on the https://github.com/csvance/roboclaw/blob/master/launch/roboclaw_single.launch modifying the ports according to the ports in my computer, also both my roboclaws are using the same ID 0x80, just a different port, then I created a copy from the diffdrive.launch that looks like this:


    <include file="/home/kingbee/robo_csvance/src/roboclaw/launch/roboclaw_front.launch"/> 
    <include file="/home/kingbee/robo_csvance/src/roboclaw/launch/roboclaw_rear.launch"/>    

    <node pkg="roboclaw" type="diffdrive_node" name="diffdrive" output="screen">
        <param name="~roboclaws" value="1"/>
        <param name="~steps_per_meter" value="12511"/>
        <param name="~base_width" value="0.4"/>
        <param name="~swap_motors" value="false"/>
        <param name="~invert_motor_1" value="false"/>
        <param name="~invert_motor_2" value="false"/>
        <param name="~var_pos_x" value="0.01"/>
        <param name="~var_pos_y" value="0.01"/>
        <param name="~var_theta_z" value="0.01"/>
    </node>
</launch>

And that works! both move properly!

My only issue is the odom which is messed up (because is reading both encoders at the same time, instead of just reading one...)

alduxvm avatar Oct 04 '20 15:10 alduxvm