Skip to content

Commit

Permalink
Modify rc_is_open logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
YoujianWu committed Mar 31, 2024
1 parent 85f747c commit e062d10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions rm_dbus/include/rm_dbus/dbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ class DBus
int16_t buff_[18]{};
bool is_success{};
bool is_update_ = false;
static ros::Time last_update_time_;
void unpack();
};

#endif // SRC_RM_BRIDGE_INCLUDE_RT_RT_DBUS_H_
#endif // SRC_RM_BASE_INCLUDE_RT_RT_DBUS_H_
11 changes: 6 additions & 5 deletions rm_dbus/src/dbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ void DBus::unpack()
is_success = true;
}

static ros::Time last_update_time_;
void DBus::getData(rm_msgs::DbusData& d_bus_data) const
{
if (is_success)
Expand Down Expand Up @@ -212,12 +213,12 @@ void DBus::getData(rm_msgs::DbusData& d_bus_data) const
if (!d_bus_data.rc_is_open)
d_bus_data.rc_is_open = !d_bus_data.rc_is_open;
}
else
{
if (d_bus_data.rc_is_open)
d_bus_data.rc_is_open = !d_bus_data.rc_is_open;
}
last_update_time_ = ros::Time::now();
}
else
{
if (d_bus_data.rc_is_open)
d_bus_data.rc_is_open = !d_bus_data.rc_is_open;
}
}
}

0 comments on commit e062d10

Please sign in to comment.