Automobile network. More...
#include <automobile_network.h>
Public Member Functions | |
| automobile_network (dsim_model_setup *setup) | |
| Constructor. | |
| void | initialization_complete () |
| Finish initialization. | |
| void | initialize_data () |
| Initialize outlets and output variables. | |
| void | initialize_timestep () |
| Computation done prior to beginning of timestep. | |
| void | pre_calculate () |
| Computation done prior to numerical integration. | |
| void | post_calculate () |
| Computation done after numerical integration. | |
| dsim_value | handle_message (const std::string &sender_path, const std::string &message_name, const dsim_value &argument) |
| Process incoming messages. | |
Protected Attributes | |
| dsim_variable | parent_yaw_matrix_dsim |
| Parent quaternion. | |
| dsim_variable | parent_position_dsim |
| Parent position. | |
| dsim_variable | transmit_dsim |
| Transmit. | |
| dsim_variable | message_outgoing_dsim |
| Message outgoing - a matrix. | |
| dsim_variable | message_incoming_dsim |
| Message incoming - a matrix. | |
| dsim_variable | position_dsim |
| Position of parent (m) | |
| ml_matrix | r |
| ml_matrix | v |
| ml_matrix | message_incoming |
Automobile network.
Models an automotive network.
This module demonstrates the use of targets and messaging. It can both send and receive messages. When the transmit command is set to 1 it sends the range to the target vehicle(s). Targets are added in the xml file.
Messages are sent in the method pre_calculate(). The handle_message method receives incoming messages.
Definition at line 23 of file automobile_network.h.
| dsim_value automobile_network::handle_message | ( | const std::string & | sender_path, |
| const std::string & | message_name, | ||
| const dsim_value & | argument | ||
| ) |
Process incoming messages.
automobile_network supports the following messages: 'automobile_network_message' !
Definition at line 129 of file automobile_network.cc.
{
if (message_name == "automobile_network_message")
{
ml_matrix temp = argument.matrix_value();
message_incoming.stack(temp);
message_incoming_dsim.set_value_as_matrix(message_incoming);
return dsim_value();
}
else return dsim_model::handle_message(sender_path,message_name,argument);
}
1.7.2