Skip to content

Commit

Permalink
imu plugin now compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
josephduchesne committed Nov 16, 2024
1 parent 28091d8 commit a687c8c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion flatland_plugins/include/flatland_plugins/diff_drive.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <tf2_ros/transform_broadcaster.h>

#include <geometry_msgs/msg/twist_stamped.hpp>
#include <geometry_msgs/msg/twist_with_covariance_stamped.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <random>

Expand All @@ -68,7 +69,7 @@ class DiffDrive : public flatland_server::ModelPlugin
rclcpp::Subscription<geometry_msgs::msg::TwistStamped>::SharedPtr twist_sub_;
rclcpp::Publisher<nav_msgs::msg::Odometry>::SharedPtr odom_pub_;
rclcpp::Publisher<nav_msgs::msg::Odometry>::SharedPtr ground_truth_pub_;
rclcpp::Publisher<geometry_msgs::msg::TwistStamped>::SharedPtr twist_pub_;
rclcpp::Publisher<geometry_msgs::msg::TwistWithCovarianceStamped>::SharedPtr twist_pub_;
Body * body_;
geometry_msgs::msg::TwistStamped::SharedPtr twist_msg_ = std::make_shared<geometry_msgs::msg::TwistStamped>();
nav_msgs::msg::Odometry odom_msg_;
Expand Down
4 changes: 2 additions & 2 deletions flatland_plugins/src/diff_drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void DiffDrive::BeforePhysicsStep(const Timekeeper & timekeeper)
if (enable_twist_pub_) {
// Transform global frame velocity into local frame to simulate encoder
// readings
geometry_msgs::msg::TwistStamped twist_pub_msg;
geometry_msgs::msg::TwistWithCovarianceStamped twist_pub_msg;
twist_pub_msg.header.stamp = timekeeper.GetSimTime();
twist_pub_msg.header.frame_id = odom_msg_.child_frame_id;

Expand All @@ -245,7 +245,7 @@ void DiffDrive::BeforePhysicsStep(const Timekeeper & timekeeper)

twist_pub_msg.twist.covariance = odom_msg_.twist.covariance;

twist_pub_.publish(twist_pub_msg);
twist_pub_->publish(twist_pub_msg);
}

// publish odom tf
Expand Down
2 changes: 1 addition & 1 deletion flatland_plugins/test/imu_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ TEST(ImuPluginTest, load_test)

// Run all the tests that were declared with TEST()
int main(int argc, char** argv) {
ros::init(argc, argv, "imu_test");
rclcpp::init(argc, argv);
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
2 changes: 1 addition & 1 deletion flatland_plugins/test/update_timer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TestPlugin : public ModelPlugin
UpdateTimer update_timer_;
int update_counter_;

void OnInitialize(const YAML::Node & config) override
void OnInitialize(const YAML::Node &) override
{
update_timer_.SetRate(0);
update_counter_ = 0;
Expand Down

0 comments on commit a687c8c

Please sign in to comment.