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 option to publish digital input data separately #128

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

seiga-k
Copy link
Contributor

@seiga-k seiga-k commented Apr 15, 2024

Currently, digital input data will publish as DigitalInput. It is useful to handle time synchronized data but it need to transform to use as common message type.

So I added option parameter to switch output message type.
In default, same behavior as current version. If set descrete_input parameter to true, it will switch to publishing std_msgs::Bool type.

@seiga-k seiga-k requested a review from at-wat April 15, 2024 08:09
@at-wat

This comment has been minimized.

Comment on lines 516 to 518
pubs_["di/" + param.name_] = compat::advertise<std_msgs::Bool>(
nh_, "di/" + param.name_,
pnh_, "di/" + param.name_, 1);
Copy link
Member

Choose a reason for hiding this comment

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

New topics don't need to support old topic path

Suggested change
pubs_["di/" + param.name_] = compat::advertise<std_msgs::Bool>(
nh_, "di/" + param.name_,
pnh_, "di/" + param.name_, 1);
pubs_["di/" + param.name_] = nh_.advertise<std_msgs::Bool>("di/" + param.name_, 1);

@@ -482,6 +483,9 @@ class YpspurRosNode
pnh_, "ad/" + ads_[i].name_, 1);
}
digital_input_enable_ = false;
pnh_.param("descrete_input", digital_input_discrete_, false);
if (digital_input_discrete_)
ROS_INFO("Digital input publish separatly");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ROS_INFO("Digital input publish separatly");
ROS_INFO("Digital input will be published separately");

@seiga-k seiga-k requested a review from at-wat April 17, 2024 03:43
@at-wat
Copy link
Member

at-wat commented Apr 17, 2024

[115] PASSED on noetic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

Copy link
Member

@at-wat at-wat left a comment

Choose a reason for hiding this comment

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

LGTM

@at-wat at-wat changed the title Add option to publish digital input data sepalatery Add option to publish digital input data separately Apr 17, 2024
@at-wat at-wat merged commit 30fd864 into master Apr 17, 2024
3 checks passed
@at-wat at-wat deleted the add_descrete_input branch April 17, 2024 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants