Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kuriatsu committed May 4, 2020
1 parent f3315cc commit 484be93
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/g29_ff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ G29ForceFeedback::G29ForceFeedback() : m_device_name("/dev/input/event19")
}


// update input event with timer callback
void G29ForceFeedback::timerCallback(const ros::TimerEvent&)
{
updateFfDevice();
}


// update input event with writing information to the event file
void G29ForceFeedback::updateFfDevice()
{
struct input_event event;
Expand Down Expand Up @@ -149,13 +151,15 @@ void G29ForceFeedback::updateFfDevice()
}


// get target information of wheel control from ros message
void G29ForceFeedback::targetCallback(const g29_ff::ForceFeedback &in_target)
{
m_target_angle = in_target.angle;
m_target_force = in_target.force;
}


// initialize force feedback device
void G29ForceFeedback::initFfDevice()
{
// setup device
Expand Down Expand Up @@ -255,6 +259,7 @@ void G29ForceFeedback::initFfDevice()
}


// util for initFfDevice()
int G29ForceFeedback::testBit(int bit, unsigned char *array)
{
return ((array[bit / (sizeof(unsigned char) * 8)] >> (bit % (sizeof(unsigned char) * 8))) & 1);
Expand Down

0 comments on commit 484be93

Please sign in to comment.