60 std::istringstream
f(dbcFile);
62 uint32_t lineNumber = 0;
68 while (std::getline(f, line,
'\n'))
75 std::string identifier;
78 identifier = parser.ReadCIdentifier();
80 catch(std::exception& ex)
82 identifier = std::string();
95 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
97 catch(std::exception& ex)
99 ROS_ERROR(
"DBC Message Parser Exception: [%s]", ex.what());
111 catch(LineParserExceptionBase& exlp)
113 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
115 catch(std::exception& ex)
117 ROS_ERROR(
"DBC Signal Parser Exception: [%s]", ex.what());
124 std::string token = parser.ReadCIdentifier();
130 std::map<std::string, NewEagle::DbcMessage>::iterator it;
136 if (it->second.GetRawId() == dbcMessageComment.
Id)
138 it->second.SetComment(dbcMessageComment);
147 std::map<std::string, NewEagle::DbcMessage>::iterator it;
150 if (it->second.GetRawId() == dbcSignalComment.
Id)
152 DbcMessage msg = it->second;
153 std::map<std::string, NewEagle::DbcSignal>::iterator its;
155 for (its = msg.GetSignals()->begin(); its != msg.GetSignals()->end(); ++its)
157 if (its->second.GetName() == dbcSignalComment.
SignalName)
167 catch(LineParserExceptionBase& exlp)
169 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
171 catch(std::exception& ex)
173 ROS_ERROR(
"DBC Comment Parser Exception: [%s]", ex.what());
184 std::map<std::string, NewEagle::DbcMessage>::iterator it;
187 if (it->second.GetRawId() == dbcAttribute.
Id)
189 std::map<std::string, NewEagle::DbcSignal>::iterator its;
190 DbcMessage msg = it->second;
191 for (its = msg.GetSignals()->begin(); its != msg.GetSignals()->end(); ++its)
193 if (its->second.GetName() == dbcAttribute.
SignalName)
202 std::stringstream ss;
203 ss << dbcAttribute.
Value;
206 double val = gain *
f + offset;
215 catch(LineParserExceptionBase& exlp)
217 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
219 catch(std::exception& ex)
221 ROS_ERROR(
"DBC Signal Value Type Parser Exception: [%s]", ex.what());
236 std::map<std::string, NewEagle::DbcMessage>::iterator it;
239 if (it->second.GetRawId() == dbcSignalValueType.
Id)
241 std::map<std::string, NewEagle::DbcSignal>::iterator its;
242 DbcMessage msg = it->second;
243 for (its = msg.GetSignals()->begin(); its != msg.GetSignals()->end(); ++its)
245 if (its->second.GetName() == dbcSignalValueType.
SignalName)
256 catch(LineParserExceptionBase& exlp)
258 ROS_WARN(
"LineParser Exception: [%s]", exlp.what());
260 catch(std::exception& ex)
262 ROS_ERROR(
"DBC Signal Value Type Parser Exception: [%s]", ex.what());