-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added VariableRateCyclicTaskABC and updated ThreadBasedCyclicSendTask #1733
base: main
Are you sure you want to change the base?
Conversation
…ented; updated default values in _check_and_apply_period_intra()
@tysonite @hardbyte @zariiii9003 I referenced PR #785 related to the relaxation of the uniqueness of the
I removed the For context, I'm making this change to allow for messages with different arbitration ids to be passed in the same task ensuring the order of transmission and improved timing. For example, with this update the J1939-76 Safety Header Message and Safety Data Message can be explicitly linked and transmitted as a sequence of messages within the same task. Any feedback / guidance is greatly appreciated. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the direction.
Would appreciate this being tested and the user facing docs being updated too.
self.msgs_len = len(messages) | ||
self.messages = messages | ||
# Take the Arbitration ID of each message and put them into a list | ||
self.arbitration_id = [self.messages[idx].arbitration_id for idx in range(self.msgs_len)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer self.arbitration_ids
for idx in range(self.msgs_len): | ||
if self.arbitration_id[idx] != messages[idx].arbitration_id: | ||
raise ValueError( | ||
"The arbitration ID of new cyclic messages cannot be changed " | ||
"from when the task was created" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tried but do you know if socketcan supports reordering the messages as well? In which case prefer to count the arbitration ids match.
:param period_intra: | ||
Period in seconds between each message when sending multiple messages | ||
in a sequence. If not provided, the period will be used for each | ||
message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Period in seconds between individual message within the sequence.
I assume no impact for sending individual messages? Could you also update the docstring for period
🙏🏼
Hi, will this PR ever be merged? I'm trying to use this library to send multipacket J1939 packets (in which the first packet will have a different arbitration ID than the others) periodically, and having the relaxed I'm currently using a PCAN interface, I just tried commenting out the code that checks I could also do a smaller PR only with the relaxed |
Hi, just wanted to say that I've been testing this PR for a while and it properly allows sending multipacket CAN messages periodically (which I'm supposing is the reason behind this PR) both on PCAN (tested on PCAN-USB X6) and Vector (tested on VN1630A). Is there any possibility to have this merged in a future release? I could also try and take care of any issues, if this PR is not worked on anymore (is that fine with you, @sschueth?). |
Hi, @DjMike238. Apologies this PR fell behind. Thank you for testing with PCAN. I have successfully tested with Vector and KVaser. I think my biggest hang up going forward is SocketCAN. I will try to make some time this week to clean up this branch. |
bus.py
to include an optional argument,period_intra
, insend_periodic
and_send_periodic_internal
VariableCyclicTaskRateABC
withinbroadcastmanager.py
to be inherited byThreadBasedCyclicTask
CyclicSendTaskABC
to help with handling a group of messagesarbitration_id
requirement within group of messages and updated the_check_modified_messages
to check for each updataed message'sarbitration_id
to preserve thatarbitration_id
does not change when a message is modifiedThreadBasedCyclicTask._run()
for variable rate transmission of messages in a group