Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
Merge pull request #63 from project-march/fix/timestamp-header
Browse files Browse the repository at this point in the history
Add header timestamp on messages
  • Loading branch information
Olavhaasie authored Aug 26, 2020
2 parents 5554c4b + ba36111 commit 894daa2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ void sendGaitMessage(const std::string& name)
if (!name.empty() && !gait_message_send)
{
is_transitioning = false;
gait_instruction_msg.header.stamp = nh.now();
gait_instruction_msg.type = march_shared_resources::GaitInstruction::GAIT;
gait_instruction_msg.gait_name = name.c_str();
gait_instruction_publisher.publish(&gait_instruction_msg);
Expand All @@ -105,6 +106,7 @@ void sendGaitMessage(const std::string& name)
void sendIncrementStepSizeMessage()
{
is_transitioning = true;
gait_instruction_msg.header.stamp = nh.now();
gait_instruction_msg.type = march_shared_resources::GaitInstruction::INCREMENT_STEP_SIZE;
gait_instruction_msg.gait_name = "";
gait_instruction_publisher.publish(&gait_instruction_msg);
Expand All @@ -113,6 +115,7 @@ void sendIncrementStepSizeMessage()
void sendDecrementStepSizeMessage()
{
is_transitioning = true;
gait_instruction_msg.header.stamp = nh.now();
gait_instruction_msg.type = march_shared_resources::GaitInstruction::DECREMENT_STEP_SIZE;
gait_instruction_msg.gait_name = "";
gait_instruction_publisher.publish(&gait_instruction_msg);
Expand All @@ -121,6 +124,7 @@ void sendDecrementStepSizeMessage()
void sendStopMessage()
{
is_transitioning = false;
gait_instruction_msg.header.stamp = nh.now();
gait_instruction_msg.type = march_shared_resources::GaitInstruction::STOP;
gait_instruction_msg.gait_name = "";
gait_instruction_publisher.publish(&gait_instruction_msg);
Expand Down

0 comments on commit 894daa2

Please sign in to comment.