UlcNode.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2018, Dataspeed Inc.
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 Dataspeed Inc. 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 ULCNODE_H
36 #define ULCNODE_H
37 
38 #include <ros/ros.h>
39 #include <std_msgs/Bool.h>
40 #include <geometry_msgs/TwistStamped.h>
41 #include <can_msgs/Frame.h>
42 #include <dataspeed_ulc_msgs/UlcCmd.h>
43 #include <dataspeed_ulc_msgs/UlcReport.h>
44 
46 
47 namespace dataspeed_ulc_can
48 {
49 
50 class UlcNode
51 {
52 public:
54 private:
55 
56  void recvCan(const can_msgs::FrameConstPtr& msg);
57  void recvUlcCmd(const dataspeed_ulc_msgs::UlcCmdConstPtr& msg);
58  void recvTwistCmd(const geometry_msgs::Twist& msg);
59  void recvTwist(const geometry_msgs::TwistConstPtr& msg);
60  void recvTwistStamped(const geometry_msgs::TwistStampedConstPtr& msg);
61  void recvEnable(const std_msgs::BoolConstPtr& msg);
62  void configTimerCb(const ros::TimerEvent& event);
63  void sendCmdMsg(bool cfg);
64  void sendCfgMsg();
65 
74 
75  dataspeed_ulc_msgs::UlcCmd ulc_cmd_;
77  bool enable_;
79 
80  // Firmware Versions
81  PlatformMap firmware_;
82 };
83 
84 }
85 
86 #endif // ULCNODE_H
dataspeed_ulc_can::UlcNode::sub_cmd_
ros::Subscriber sub_cmd_
Definition: UlcNode.h:130
dataspeed_ulc_can::UlcNode::recvTwist
void recvTwist(const geometry_msgs::TwistConstPtr &msg)
Definition: UlcNode.cpp:234
ros::Publisher
pn
ros::NodeHandle * pn
Definition: test_ulc_node.cpp:14
dataspeed_ulc_can
Definition: dispatch.h:39
dataspeed_ulc_can::UlcNode::firmware_
PlatformMap firmware_
Definition: UlcNode.h:145
ros.h
dataspeed_ulc_can::UlcNode::enable_
bool enable_
Definition: UlcNode.h:141
dataspeed_ulc_can::UlcNode::cmd_stamp_
ros::Time cmd_stamp_
Definition: UlcNode.h:140
dataspeed_ulc_can::UlcNode::configTimerCb
void configTimerCb(const ros::TimerEvent &event)
Definition: UlcNode.cpp:385
dataspeed_ulc_can::UlcNode::recvCan
void recvCan(const can_msgs::FrameConstPtr &msg)
Definition: UlcNode.cpp:244
dataspeed_ulc_can::UlcNode::recvTwistCmd
void recvTwistCmd(const geometry_msgs::Twist &msg)
Definition: UlcNode.cpp:208
dataspeed_ulc_can::UlcNode::pub_can_
ros::Publisher pub_can_
Definition: UlcNode.h:136
dataspeed_ulc_can::UlcNode::config_timer_
ros::Timer config_timer_
Definition: UlcNode.h:137
dataspeed_ulc_can::UlcNode::recvEnable
void recvEnable(const std_msgs::BoolConstPtr &msg)
Definition: UlcNode.cpp:183
dataspeed_ulc_can::UlcNode::recvUlcCmd
void recvUlcCmd(const dataspeed_ulc_msgs::UlcCmdConstPtr &msg)
Definition: UlcNode.cpp:188
dataspeed_ulc_can::UlcNode::sub_enable_
ros::Subscriber sub_enable_
Definition: UlcNode.h:134
dataspeed_ulc_can::UlcNode::UlcNode
UlcNode(ros::NodeHandle &n, ros::NodeHandle &pn)
Definition: UlcNode.cpp:162
n
ros::NodeHandle * n
Definition: test_ulc_node.cpp:14
dataspeed_ulc_can::UlcNode::pub_report_
ros::Publisher pub_report_
Definition: UlcNode.h:135
ros::TimerEvent
dataspeed_ulc_can::UlcNode::recvTwistStamped
void recvTwistStamped(const geometry_msgs::TwistStampedConstPtr &msg)
Definition: UlcNode.cpp:239
dataspeed_ulc_can::UlcNode::sub_can_
ros::Subscriber sub_can_
Definition: UlcNode.h:133
PlatformMap.h
dataspeed_ulc_can::UlcNode::accel_mode_supported_
bool accel_mode_supported_
Definition: UlcNode.h:142
ros::Time
dataspeed_ulc_can::UlcNode::ulc_cmd_
dataspeed_ulc_msgs::UlcCmd ulc_cmd_
Definition: UlcNode.h:139
dataspeed_ulc_can::UlcNode::sub_twist_stamped_
ros::Subscriber sub_twist_stamped_
Definition: UlcNode.h:132
dataspeed_ulc_can::UlcNode::sub_twist_
ros::Subscriber sub_twist_
Definition: UlcNode.h:131
dataspeed_ulc_can::UlcNode::sendCmdMsg
void sendCmdMsg(bool cfg)
Definition: UlcNode.cpp:294
ros::Timer
ros::NodeHandle
ros::Subscriber
dataspeed_ulc_can::UlcNode::sendCfgMsg
void sendCfgMsg()
Definition: UlcNode.cpp:359


dataspeed_ulc_can
Author(s): Micho Radovnikovich
autogenerated on Sat Dec 3 2022 03:34:49