Fix Version/s: None
It appears that in ts_sal 3.9 every command topic starts with the same private_seqNum (some large integer). As a result the same seqNum is being used by all the different commands.
Two solutions that come to mind (and I'm sure there are others):
1) Use another existing ackcmd field or add a field that identifies which command the ack is for. For instance an integer that specifies the index of the command in the known command topics.
Then one can use a different content-filtered ackcmd reader for each command, for instance in SALPY using the ackCommand_x and getResponse_x functions will do exactly what a user might expect.
Does SAL provide similar functions for other languages?
2) Divide the sequence numbers up so that each command has its own range of sequence numbers. Each command writer starts out with the minimum value and rolls over when it hits the maximum.
This is a simpler change, but it means that code must (continue to) read one ackcmd topic to read acks for all commands. For instance one would use getResponse_start to read acks for all commands, including enable, disable, exitControl... which is surprising, to say the least.
salobj has not been doing this and so has a subtle bug I need to fix. I wonder how many other languages have the same bug?
(You could fix the bug using content filtered readers based on seqNum range, but that sounds riskier and hackier than using a separate field to identify the command).
DM-19697: the ackcmd topic does not offer a way to differentiate between ackcmds for a command sent by different remotes.
What we have done so far (all we could do without changing the ackcmd topic):
- Use specific ranges of IDs for commands.
- Use random starting #s to ameliorate
DM-19697: it isn't a perfect solution but greatly reduces the odds of a problem.
SAL 4/salobj 5 will fix
In other words: this looks good to me. Please close it.
This was fixed in SAL and ts_salobj (but
DM-19697helps a lot).