Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Split magnetometer node into C++ class and header #817

Closed
wants to merge 1 commit into from

Conversation

diazcpu1
Copy link
Contributor

Description

Rewrite the igvc_gazebo/magnetometer node to be a C++ class

This PR does the following:

  • Replaces main.cpp with a Magnetometer.cpp and Magnetometer.h

Fixes #740

Testing steps (If relevant)

Test Case 1

  1. Tested original node

Test Case 2

  1. Tested new branch

Expectation: Retain functionality of the node

Self Checklist

  • I have formatted my code using make format
  • I have tested that the new behaviour works

Copy link
Contributor

@matthewhannay567 matthewhannay567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, just a small variable name error. Also, change the name of the files to be all lowercase, so it should be magnetometer.cpp, etc.

Also, be sure to test and see if the code compiles before making a PR, just to make sure you didn't miss any obvious errors, as well as running make format to fix any code format problems.

std::string sub_topic = pnh.param("mag_sub_topic", std::string("/magnetometer/vector"));
std::string pub_topic = pnh.param("mag_pub_topic", std::string("/magnetometer_mag"));
g_mag_field_covar = pnh.param("mag_field_variance", 1e-6);
g_mag_field_pub = nh.advertise<sensor_msgs::MagneticField>(pub_topic, 10);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you are still using the g_ prefix, while the member variable does not have it. Remove the g_ prefix.

@VAM7686 VAM7686 closed this Nov 18, 2021
@VAM7686 VAM7686 deleted the feat/magnetometer_node_to_cpp_class branch November 18, 2021 01:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite the igvc_gazebo/magnetometer node to be a C++ class
3 participants