-
Notifications
You must be signed in to change notification settings - Fork 20
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
Conversation
This comment has been minimized.
This comment has been minimized.
src/ypspur_ros.cpp
Outdated
pubs_["di/" + param.name_] = compat::advertise<std_msgs::Bool>( | ||
nh_, "di/" + param.name_, | ||
pnh_, "di/" + param.name_, 1); |
There was a problem hiding this comment.
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
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); |
src/ypspur_ros.cpp
Outdated
@@ -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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ROS_INFO("Digital input publish separatly"); | |
ROS_INFO("Digital input will be published separately"); |
[115] PASSED on noeticAll tests passed
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 publishingstd_msgs::Bool
type.