43 , sync_can_slave1_(8,
boost::bind(&
PdsNode::recvSync, this, _1,
SLAVE1),
ID_STATUS1_SLAVE1,
ID_STATUS2_SLAVE1,
ID_CURRENT1_SLAVE1,
ID_CURRENT2_SLAVE1,
ID_CURRENT3_SLAVE1)
44 , sync_can_slave2_(8,
boost::bind(&
PdsNode::recvSync, this, _1,
SLAVE2),
ID_STATUS1_SLAVE2,
ID_STATUS2_SLAVE2,
ID_CURRENT1_SLAVE2,
ID_CURRENT2_SLAVE2,
ID_CURRENT3_SLAVE2)
45 , sync_can_slave3_(8,
boost::bind(&
PdsNode::recvSync, this, _1,
SLAVE3),
ID_STATUS1_SLAVE3,
ID_STATUS2_SLAVE3,
ID_CURRENT1_SLAVE3,
ID_CURRENT2_SLAVE3,
ID_CURRENT3_SLAVE3)
62 sync_ros_slave2_->setInterMessageLowerBound(SYNC_50_MS);
63 sync_ros_slave3_->setInterMessageLowerBound(SYNC_50_MS);
93 if (!msg->is_rtr && !msg->is_error && !msg->is_extended) {
134 ROS_WARN(
"Unknown message ID: %1$d (0x%1$01x)", msg->id);
144 ((
MsgRelay*)out.data.elems)->channel = msg->channel;
145 ((
MsgRelay*)out.data.elems)->request = msg->request;
148 out.is_extended =
false;
155 ((
MsgMode*)out.data.elems)->mode = msg->mode;
158 out.is_extended =
false;
169 out.is_extended =
false;
194 dataspeed_pds_msgs::Status msg;
195 msg.header.stamp = msgs[0]->header.stamp;
196 msg.mode.mode = ptrS1->
mode;
197 msg.script.script = ptrS1->
script;
228 msg.master.temp.external =
bytesToCelsius(ptrS2->thermocouple_temp);
232 const dataspeed_pds_msgs::Status::ConstPtr ptr(
new dataspeed_pds_msgs::Status(msg));
260 dataspeed_pds_msgs::Status msg = *master;
261 msg.chan.insert(msg.chan.end(), slave1->chan.begin(), slave1->chan.end());
262 msg.slave.push_back(slave1->master);
269 dataspeed_pds_msgs::Status msg = *master;
270 msg.chan.insert(msg.chan.end(), slave1->chan.begin(), slave1->chan.end());
271 msg.chan.insert(msg.chan.end(), slave2->chan.begin(), slave2->chan.end());
272 msg.slave.push_back(slave1->master);
273 msg.slave.push_back(slave2->master);
280 dataspeed_pds_msgs::Status msg = *master;
281 msg.chan.insert(msg.chan.end(), slave1->chan.begin(), slave1->chan.end());
282 msg.chan.insert(msg.chan.end(), slave2->chan.begin(), slave2->chan.end());
283 msg.chan.insert(msg.chan.end(), slave3->chan.begin(), slave3->chan.end());
284 msg.slave.push_back(slave1->master);
285 msg.slave.push_back(slave2->master);
286 msg.slave.push_back(slave3->master);
uint8_t inverter_overtemp
void recvSync(const std::vector< can_msgs::Frame::ConstPtr > &msgs, UnitId id)
uint8_t inverter_overload
message_filters::Synchronizer< SyncPolicy3 > * sync_ros_slave3_
void publish(const boost::shared_ptr< M > &message) const
void recvMode(const dataspeed_pds_msgs::Mode::ConstPtr &msg)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
message_filters::Synchronizer< SyncPolicy2 > * sync_ros_slave2_
float bytesToVoltage(uint16_t input)
dataspeed_pds_msgs::Status::ConstPtr SyncPtr
message_filters::PassThrough< SyncMsg > sync_msg_master_
void processMsg(const Type &msg)
message_filters::PassThrough< SyncMsg > sync_msg_slave1_
message_filters::PassThrough< SyncMsg > sync_msg_slave3_
message_filters::PassThrough< SyncMsg > sync_msg_slave2_
dataspeed_can_msg_filters::ApproximateTime sync_can_slave1_
void recvSyncSlave3(const SyncPtr &master, const SyncPtr &slave1, const SyncPtr &slave2, const SyncPtr &slave3)
message_filters::sync_policies::ApproximateTime< SyncMsg, SyncMsg > SyncPolicy1
ros::Subscriber sub_relay_
Connection registerCallback(C &callback)
dataspeed_can_msg_filters::ApproximateTime sync_can_slave2_
void recvRelay(const dataspeed_pds_msgs::Relay::ConstPtr &msg)
void recvCAN(const can_msgs::Frame::ConstPtr &msg)
void recvScript(const dataspeed_pds_msgs::Script::ConstPtr &msg)
dataspeed_can_msg_filters::ApproximateTime sync_can_master_
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
const ros::Duration TIMEOUT(0.5)
PdsNode(ros::NodeHandle &node, ros::NodeHandle &priv_nh)
float bytesToAmperes(int16_t input)
float bytesToCelsius(int8_t input)
ros::Subscriber sub_script_
dataspeed_can_msg_filters::ApproximateTime sync_can_slave3_
ros::Publisher pub_status_
void setInterMessageLowerBound(ros::Duration lower_bound)
void add(const MConstPtr &msg)
message_filters::sync_policies::ApproximateTime< SyncMsg, SyncMsg, SyncMsg, SyncMsg > SyncPolicy3
message_filters::Synchronizer< SyncPolicy1 > * sync_ros_slave1_
message_filters::sync_policies::ApproximateTime< SyncMsg, SyncMsg, SyncMsg > SyncPolicy2
void recvSyncSlave2(const SyncPtr &master, const SyncPtr &slave1, const SyncPtr &slave2)
void recvSyncSlave1(const SyncPtr &master, const SyncPtr &slave1)
ros::Subscriber sub_mode_