pdu.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2018 New Eagle
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of New Eagle nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 #ifndef NEWEAGLE_PDU_H_
36 #define NEWEAGLE_PDU_H_
37 
38 #include <ros/ros.h>
39 
40 // ROS messages
41 #include <can_msgs/Frame.h>
42 #include <pdu_msgs/FuseReport.h>
43 #include <pdu_msgs/RelayReport.h>
44 #include <pdu_msgs/RelayCommand.h>
45 #include <std_msgs/Empty.h>
46 #include <std_msgs/Bool.h>
47 #include <std_msgs/String.h>
48 
51 #include <can_dbc_parser/Dbc.h>
53 
54 namespace NewEagle
55 {
56  class pdu
57  {
58  enum {
59  RELAY_STATUS_BASE_ADDR = 0x18ffa100,
60  FUSE_STATUS_BASE_ADDR = 0x18ffa000,
62  };
63 
64  public:
65  pdu(ros::NodeHandle &node, ros::NodeHandle &priv_nh);
66 
67  private:
68  uint32_t id_;
70  uint32_t relayStatusAddr_;
71  uint32_t fuseStatusAddr_;
72 
73  uint32_t count_;
74 
76  std::string pduFile_;
77 
78  void recvCAN(const can_msgs::Frame::ConstPtr& msg);
79  void recvRelayCmd(const pdu_msgs::RelayCommand::ConstPtr& msg);
80 
81  // Subscribed topics
84 
85  // Published topics
89  };
90 }
91 
92 #endif /* NEWEAGLE_PDU_H_ */
ros::Subscriber sub_can_
Definition: pdu.h:82
void recvCAN(const can_msgs::Frame::ConstPtr &msg)
Definition: pdu.cpp:74
ros::Publisher relay_report_pub_
Definition: pdu.h:88
ros::Publisher pub_can_
Definition: pdu.h:86
ros::Publisher fuse_report_pub_
Definition: pdu.h:87
std::string pduFile_
Definition: pdu.h:76
uint32_t fuseStatusAddr_
Definition: pdu.h:71
void recvRelayCmd(const pdu_msgs::RelayCommand::ConstPtr &msg)
Definition: pdu.cpp:129
ros::Subscriber sub_relay_cmd_
Definition: pdu.h:83
uint32_t relayStatusAddr_
Definition: pdu.h:70
pdu(ros::NodeHandle &node, ros::NodeHandle &priv_nh)
Definition: pdu.cpp:46
NewEagle::Dbc pduDbc_
Definition: pdu.h:75
uint32_t count_
Definition: pdu.h:73
uint32_t relayCommandAddr_
Definition: pdu.h:69
uint32_t id_
Definition: pdu.h:68


pdu
Author(s): Ryan Borchert
autogenerated on Sat Jan 9 2021 03:56:20