-
Notifications
You must be signed in to change notification settings - Fork 13
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
Common functionality for SUMO CARMA Messenger Vehicle Plugin #226
Conversation
for msg_veh_id in msg_veh_ids: | ||
|
||
if msg_veh_id not in sumo_veh_ids and \ | ||
msger_veh_cfg.get_veh_state(msg_veh_id) == 0 and \ |
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.
Having some sort of constant for this 0 would be good. What state is that supposed to represent?
sumo_connector.set_veh_speed(msg_veh_id, msger_veh_cfg.get_veh_speed(msg_veh_id)) | ||
sumo_connector.set_veh_lcm(msg_veh_id, msger_veh_cfg.get_veh_lcm(msg_veh_id)) | ||
sumo_connector.set_veh_type(msg_veh_id, msger_veh_cfg.get_veh_cfm(msg_veh_id)) | ||
msger_veh_cfg.set_veh_state(msg_veh_id, 1) |
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.
Similar comment here re: state.
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.
Might be cleanest to define some sort of enum with these numerical values for states, and then reference that enum instead of the raw integer literal values.
"lcm": veh["lcm"], | ||
"cfm": veh["cfm"] | ||
} | ||
self._veh_state_dict[veh_id] = 0 |
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.
Would be good to define the states as an Enum type, and then use the state names instead of int literals.
Quality Gate passedIssues Measures |
PR Details
Description
This PR introduces the implementation of the CARMA-messenger vehicle plugin for CDASim, aligning with the High-level Design for Freight ERV functionality documentation
Related GitHub Issue
Related Jira Key
CXC-87
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: