-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 8 additions & 14 deletions
22
control_ws/src/stanley/include/stanley/canprotocol/can_protocol.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,28 @@ | ||
#pragma once | ||
|
||
#include "utils/car_struct.h" | ||
#include "utils/msg_structs.h" | ||
|
||
#include "dbcppp/include/dbcppp/Network.h" | ||
|
||
#include <iostream> | ||
#include <fstream> | ||
#include <unordered_map> | ||
#include <cstring> | ||
#include <linux/can.h> | ||
#include <linux/can/raw.h> | ||
#include <sys/socket.h> | ||
#include <sys/ioctl.h> | ||
#include <net/if.h> | ||
#include <unistd.h> | ||
#include <iostream> | ||
#include <fstream> | ||
#include <unordered_map> | ||
#include <memory> | ||
#include <chrono> | ||
#include <string> | ||
#include <unordered_map> | ||
|
||
#include "dbcppp/Network.h" | ||
|
||
class CANSender { | ||
public: | ||
CANSender(const std::string& dbc_file, const std::string& can_interface); | ||
~CANSender(); | ||
void sendSpeedMessage(double speed); | ||
|
||
private: | ||
int sock; | ||
uint64_t target_message_id; | ||
double speed_value; | ||
std::shared_ptr<const dbcppp::INetwork> net; | ||
std::unique_ptr<dbcppp::INetwork> net; | ||
std::unordered_map<uint64_t, const dbcppp::IMessage*> messages; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
VERSION "" | ||
|
||
NS_ : | ||
NS_DESC_ | ||
CM_ | ||
BA_DEF_ | ||
BA_ | ||
VAL_ | ||
CAT_DEF_ | ||
CAT_ | ||
FILTER | ||
BA_DEF_DEF_ | ||
EV_DATA_ | ||
ENVVAR_DATA_ | ||
SGTYPE_ | ||
SGTYPE_VAL_ | ||
BA_DEF_SGTYPE_ | ||
BA_SGTYPE_ | ||
SIG_TYPE_REF_ | ||
VAL_TABLE_ | ||
SIG_GROUP_ | ||
SIG_VALTYPE_ | ||
SIGTYPE_VALTYPE_ | ||
BO_TX_BU_ | ||
BA_DEF_REL_ | ||
BA_REL_ | ||
BA_DEF_DEF_REL_ | ||
BU_SG_REL_ | ||
BU_EV_REL_ | ||
BU_BO_REL_ | ||
SG_MUL_VAL_ | ||
|
||
BS_: | ||
|
||
BU_: PCM | ||
|
||
BO_ 255 SpeedMessage1: 8 PCM | ||
SG_ Speed : 0|16@1+ (1,0) [0|65535] "" PCM | ||
|
||
BO_ 254 SpeedMessage2: 8 PCM | ||
SG_ Speed : 0|16@1+ (1,0) [0|65535] "" PCM | ||
|
||
CM_ "Example DBC file with two messages using the same data structure but different IDs."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters