48 {
50 AINFO <<
"TransitController has already been initialized.";
51 return ErrorCode::CANBUS_ERROR;
52 }
53
55 common::VehicleConfigHelper::Instance()->GetConfig().vehicle_param());
56
58 if (!
params_.has_driving_mode()) {
59 AERROR <<
"Vehicle conf pb not set driving_mode.";
60 return ErrorCode::CANBUS_ERROR;
61 }
62
63 if (can_sender == nullptr) {
64 AERROR <<
"Canbus sender is null.";
65 return ErrorCode::CANBUS_ERROR;
66 }
68
69 if (message_manager == nullptr) {
70 AERROR <<
"protocol manager is null.";
71 return ErrorCode::CANBUS_ERROR;
72 }
74
75
76 adc_auxiliarycontrol_110_ = dynamic_cast<Adcauxiliarycontrol110*>(
78 if (adc_auxiliarycontrol_110_ == nullptr) {
79 AERROR <<
"Adcauxiliarycontrol110 does not exist in the "
80 "TransitMessageManager!";
81 return ErrorCode::CANBUS_ERROR;
82 }
83
84 adc_motioncontrol1_10_ = dynamic_cast<Adcmotioncontrol110*>(
86 if (adc_motioncontrol1_10_ == nullptr) {
88 << "Adcmotioncontrol110 does not exist in the TransitMessageManager!";
89 return ErrorCode::CANBUS_ERROR;
90 }
91
92 adc_motioncontrollimits1_12_ = dynamic_cast<Adcmotioncontrollimits112*>(
95 if (adc_motioncontrollimits1_12_ == nullptr) {
96 AERROR <<
"Adcmotioncontrollimits112 does not exist in the "
97 "TransitMessageManager!";
98 return ErrorCode::CANBUS_ERROR;
99 }
100
101 llc_diag_brakecontrol_721_ = dynamic_cast<Llcdiagbrakecontrol721*>(
103 if (llc_diag_brakecontrol_721_ == nullptr) {
104 AERROR <<
"Llcdiagbrakecontrol721 does not exist in the "
105 "TransitMessageManager!";
106 return ErrorCode::CANBUS_ERROR;
107 }
108
109 llc_diag_steeringcontrol_722_ = dynamic_cast<Llcdiagsteeringcontrol722*>(
112 if (llc_diag_steeringcontrol_722_ == nullptr) {
113 AERROR <<
"Llcdiagsteeringcontrol722 does not exist in the "
114 "TransitMessageManager!";
115 return ErrorCode::CANBUS_ERROR;
116 }
117
119 false);
121 false);
123 adc_motioncontrollimits1_12_, false);
125 llc_diag_brakecontrol_721_, false);
127 llc_diag_steeringcontrol_722_, false);
128
129
130 AINFO <<
"TransitController is initialized.";
131
133 return ErrorCode::OK;
134}
canbus::VehicleParameter params_
CanSender< ::apollo::canbus::Transit > * can_sender_