dumbotics / roboclaw_hardware_interface

ROS2 Control hardware interface for the BasicMicro RoboClaw
Apache License 2.0
5 stars 2 forks source link

4 WD packet serial connection #10

Closed BooraKaushik closed 1 month ago

BooraKaushik commented 3 months ago

Hi @coxep, I have 2 roboclaws one controlling the 2 forward wheels and another controlling the back wheels, I am trying to connect them in packet serial mode, do you have some documentation shedding light on how to do that?

coxep commented 3 months ago

Disregard the prior comment.

@BooraKaushik checkout this: https://resources.basicmicro.com/using-multiple-roboclaws-with-arduino/

coxep commented 3 months ago

@BooraKaushik Here's another one that might be more relevant: https://resources.basicmicro.com/packet-serial-bus-operation-with-the-raspberry-pi-3/

I haven't done this myself, so curious to see how well it works. If you get it up and running, I'd love to feature instructions for 4+ WD on the readme

coxep commented 3 months ago

@BooraKaushik one final link: https://forums.basicmicro.com/viewtopic.php?t=442

Seems possible to set one device to master and the other to multi-unit mode to control both over a single USB connection. Good luck!

coxep commented 3 months ago

@BooraKaushik did you get this resolved?

BooraKaushik commented 3 months ago

Hi eric sorry, forgot to give you an update. Seems like one of my roboclaws got damaged so it might take some more time for me to test.

BooraKaushik commented 2 months ago

Hi @coxep , I have 2 Roboclaw Motor Controllers 2*30A, I am trying to connect them serially using the Packet Serial mode so that I can control both the roboclaws using 1 USB. I have tried the following, but it seems not to work. Approach: Set the one unit to Relay mode(but not to Multi-unit mode). Set the other unit to Multi-Unit and Relay mode and change to a non conflicting address in My case (master is set to 128 and slave is set 129). Connect S1 on the master to the slave's S2. Connect S2 on the master to the slave's S1. I have connected the USB to Master to check if I could see both Port 128 and 129 come up on app, and they don't.

I tried setting both to relay mode and MultiUnit Mode and set both in relay Mode as well but seems like it doesn't work. I checked out the documentation that you have provided in which all of them describe the above approach Do you know whats wrong here?.

Thanks, Kaushik

coxep commented 2 months ago

Hi @BooraKaushik , could you setting the first unit (USB) to relay mode, and leave multi-unit AND relay mode unchecked for the second roboclaw. Also check that the addresses for the two units are different

BooraKaushik commented 2 months ago

@coxep That actually worked, thanks a lot. Now I am able to see both my roboclaws on the Basicmicro Motion studio app. I will try and see if the commands work and update you

BooraKaushik commented 2 months ago

@coxep I am getting the following error when I try to run dumbot_bringup

[ros2_control_node-1] [INFO] [1713059972.077669636] [controller_manager]: update rate is 100 Hz [ros2_control_node-1] terminate called after throwing an instance of 'std::runtime_error' [ros2_control_node-1] what(): Read timeout!

coxep commented 2 months ago

@coxep I am getting the following error when I try to run dumbot_bringup

[ros2_control_node-1] [INFO] [1713059972.077669636] [controller_manager]: update rate is 100 Hz [ros2_control_node-1] terminate called after throwing an instance of 'std::runtime_error' [ros2_control_node-1] what(): Read timeout!

Dumbot_bringup doesn't support 4wd out of the box. It is a model of a 2wd robot.

You could try double checking the PID params, serial address, serial device. I'd try checking sending requests and getting feedback for each roboclaw unit (same USB port, different serial address) using dumbot bringup.

If this works for each motors pair, I can help you extend dumbot bring up support for 4wd

BooraKaushik commented 2 months ago

Hi @coxep, I have set only one address as of now so isn't it like a 2WD, so theoretically shouldn't it be able to drive the front two wheels?

EDIT: So I have tested it with by disconnecting the other motor controller seems like the standalone one works fine its just that when the other motor controller is connected it is not able to communicate with either.

Can we connect today @coxep if you have time ?

coxep commented 2 months ago

Yes, in theory it should drive the front pair of wheels in the multi-roboclaw configuration.

Do other drivers you've used (such as roboclaw's python3 library) work with the multi-roboclaw configuration?

I don't have availability today unfortunately. Do you have some time this weekend?

On Wed, Apr 17, 2024, 12:59 PM BooraKaushik @.***> wrote:

Hi @coxep https://github.com/coxep, I have set only one address as of now so isn't it like a 2WD, so theoretically shouldn't it be able to drive the front two wheels?

— Reply to this email directly, view it on GitHub https://github.com/dumbotics/roboclaw_hardware_interface/issues/10#issuecomment-2061774310, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHEJCCHGR4NLNCJ5ZSEX5T3Y52S6XAVCNFSM6AAAAABEJGYWLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRRG43TIMZRGA . You are receiving this because you were mentioned.Message ID: @.***>

BooraKaushik commented 2 months ago

Yeah @coxep, seems like when multiple roboclaws are connected the library can't read/write data onto them. I tried using the default roboclaw python library and all four wheels seem to run. yeah, the weekend works for me.

coxep commented 2 months ago

Ok, that's great news! We should be able to get this working then

On Wed, Apr 17, 2024, 5:42 PM BooraKaushik @.***> wrote:

Yeah @coxep https://github.com/coxep, seems like when multiple roboclaws are connected the library can't read/write data onto them. I tried using the default roboclaw python library and all four wheels seem to run. yeah, the weekend works for me.

— Reply to this email directly, view it on GitHub https://github.com/dumbotics/roboclaw_hardware_interface/issues/10#issuecomment-2062455108, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHEJCCGM4J76VI6CPRSWHBDY53UFTAVCNFSM6AAAAABEJGYWLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRSGQ2TKMJQHA . You are receiving this because you were mentioned.Message ID: @.***>

BooraKaushik commented 2 months ago

Okay @coxep, when do you want to connect in the weekend?

coxep commented 2 months ago

Okay @coxep, when do you want to connect in the weekend?

Sent you an email

coxep commented 1 month ago

@BooraKaushik any updates on your end for this? Did you get support from BasicMicro?