Add mcm version querying / identification#32
Conversation
|
|
||
| inline bool operator==(const McmIdentity & a, const McmIdentity & b) | ||
| { | ||
| return a.module_serial_number == b.module_serial_number && a.product_id == b.product_id && |
There was a problem hiding this comment.
i'd prefer this be broken into a few lines to be a little more readable if possible :P
There was a problem hiding this comment.
we are of the same mind, which is why I had attempted to do so before checking this in but the linter clobbered my readability changes! fixed in a2d296e
…them Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
a2d296e to
6e8e13b
Compare
|
|
||
| /// @brief Get the recorded identity for the named MCM endpoint. | ||
| /// @return std::nullopt if no MCM with this bus/subsystem is registered, or none has responded yet. | ||
| std::optional<McmIdentity> get_mcm_identity(uint8_t bus_address, uint8_t subsystem_id) const; |
There was a problem hiding this comment.
So this isn't just for MCM. If you look at the different identify dbc files for the different devices you'll notice they're all identical:
https://github.com/polymathrobotics/sygnal/blob/main/sygnal_dbc/database/mcm/Identify.dbc
https://github.com/polymathrobotics/sygnal/blob/main/sygnal_dbc/database/hpo/Identify.dbc
https://github.com/polymathrobotics/sygnal/blob/main/sygnal_dbc/database/cb/Identify.dbc
So when you send an identify command you will get a response from ALL sygnal devices. What we can do initially is to probably catalog all devices that are connected with their default responses. Later we can probably put MCM into MCM structs, HPO into HPO structs when we get the mapping of product ids to devices
There was a problem hiding this comment.
For now we could also correlate bus_id and subsystem_id with the response content so auto-fill based on what bus_id and subsystem_id they respond with
There was a problem hiding this comment.
Looks like you're already passing it into the MCM, so that second point is covered!
But we may want to just record anything that isn't filling an expected object to be recorded somewhere so we have a record of all responses. Then we can forward that information to the right object too?
Basically have 2 parse steps:
- One records raw indentify response vector of ALL objects detected and one that actually puts it into objects we're expecting like MCMs?
Can be pushed to a separate issue
Adds support for querying MCM identity and firmware versions over the Identify protocol (
Identify.dbc), across the library and ROS 2 layers.On the ROS side, this PR introduces
McmIdentity.msgandQueryIdentities.srv. The~/query_identitiesservice broadcasts anidentifymsg, waits for responses to come in and returns identifications for each device.~/mcm_identity_bus<b>_sub<s>, topic, published once onon_activateand republished only on change.Separately, this PR also introduces a fix for MCM entries being reset, but the vector that contains them not being emptied
on_cleanup, which left the possibility for duplicate publishers to exist if the node went through multiple state transition cyclesCloses #31