Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add timestamps to the published trajectory #129

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@

# Matlab
*.m~

# vscode & clion
.vscode
.idea
cmake-build-debug
2 changes: 2 additions & 0 deletions mav_trajectory_generation_ros/src/trajectory_sampler_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void TrajectorySamplerNode::processTrajectory() {
&trajectory_points);
trajectory_msgs::MultiDOFJointTrajectory msg_pub;
msgMultiDofJointTrajectoryFromEigen(trajectory_points, &msg_pub);
msg_pub.header.stamp = ros::Time::now();
command_pub_.publish(msg_pub);
} else {
publish_timer_.start();
Expand All @@ -118,6 +119,7 @@ bool TrajectorySamplerNode::stopSamplingCallback(
void TrajectorySamplerNode::commandTimerCallback(const ros::TimerEvent&) {
if (current_sample_time_ <= trajectory_.getMaxTime()) {
trajectory_msgs::MultiDOFJointTrajectory msg;
msg.header.stamp = ros::Time::now();
mav_msgs::EigenTrajectoryPoint trajectory_point;
bool success = mav_trajectory_generation::sampleTrajectoryAtTime(
trajectory_, current_sample_time_, &trajectory_point);
Expand Down