Network topology discovery #35
-
I am trying to see what, if any, ways there are to automatically discover the connectivity of the modules. This would make it so I wouldn't need to hand-code all the module serial numbers in the code. For example, if I have a chain of them, and I can see them all on the network, is there any way to find out what order they are in the chain? In the C++ API for the Lookup class I see a "getConnectedGroupFromName" function but I suspect this is deprecated and don't know what it does since I mostly use the python API these days. Similarly, if I have an ethernet switch where multiple modules are connected to it, can I find out which port each module is located on? I think this is less of a hebi problem and more of a switch problem-- I've been googling it and it seems to be possible if you have special software and a managed switch. But the small lightweight ones I like to use are unmanaged, and I'd like to do it via Python commands. Anyone have any thoughts on how I can do this?
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Hi, There is not really an easy way to determine the order. The connected group functionality is specific to the snake modules - they have serial connections between each module in addition to the Ethernet connection. I know Dave has messed around with using the IMUs coupled with some amount of movement to work out the physical order of an arm. You could also wire up all of the M-Stop inputs separately to an IO Board and trigger them in order but this would make the wiring pretty messy. Maybe at least making a script that commands the LEDs to change color in a certain order would help.
|
Beta Was this translation helpful? Give feedback.
-
Like Curtis said, we don't have a great general way of determining ID. The two methods we've tried to get a partial solution so far only work for actuators that are known to be chained together in series. Using Kinematics + IMUs: Using Network Latency: I can dig up and post some Matlab code that does these methods if you're interested. -Dave
|
Beta Was this translation helpful? Give feedback.
-
I was busy making plots, so Dave beat me to it 👿 1) Using Network Latency
1 2) Manual Setup
In any case, encoding the connectivity via a naming convention would at least get rid of the painful step of hard coding serial numbers.
|
Beta Was this translation helpful? Give feedback.
-
Thanks for all the suggestions. I like the LED idea, I will think about how to adapt that for my custom hexapod. I'm switching around their order frequently so constantly crawling under it to find the serial numbers has become tiring.
|
Beta Was this translation helpful? Give feedback.
-
One more comment on the LEDs to identify actuators: This situation is why two of the buttons in Scope on the Dashboard, and in the right-click menu for the Module List, are 'Red LED' and 'Clear LED'. You can select an actuator, and manually check the position on the robot, and then change its name, paste its SN, or whatever other method you use to make your groups. Sorry if you know about this already. Just wanted to point this out, since having all the serial numbers / names in Scope at least keeps you from having to physically find the serial numbers on the actuators on the robot. But you do have to be close enough to see the LED color. Hope that helps,
|
Beta Was this translation helpful? Give feedback.
-
Setting up a dedicated machine, a dedicated network, and spamming messages for 5-10 minutes could probably make the network latency reliable enough. It's not usable for auto-configuration on boot, but if you only ever need that information after a physical hardware change, that may be good enough. You could always do a sanity check by comparing the IMUs against the determined configuration. It's a shame that the switches technically already know about the network topology (see Spanning Tree Protocl), but so far I've unfortunately never found a good way to access that information.
|
Beta Was this translation helpful? Give feedback.
-
Thanks for all the suggestions. I like the LED idea
|
Beta Was this translation helpful? Give feedback.
Thanks for all the suggestions. I like the LED idea, I will think about how to adapt that for my custom hexapod. I'm switching around their order frequently so constantly crawling under it to find the serial numbers has become tiring.
Since I don't have a serial-chain robot, the IMU method would be hard to use. I am looking for methods that could help me determine the leg ordering on a hexapod, for instance, where each leg is plugged into a network switch (my case), or when all legs are in a big chain like Daisy.
The network latency thing seems interesting. I wonder if there's some way to make that more reliable?
It seems unintuitive to me that this should be such a difficult problem, so …