rename "24G" to "2G4"

This commit is contained in:
Florian Zirker 2018-12-11 12:35:53 +01:00
parent 1221c1e2f2
commit 11c0cbbdb0
3 changed files with 8 additions and 8 deletions

View file

@ -14,7 +14,7 @@
<!-- Set wifi interface and start wlan logging -->
<group if="$(arg enableWlanScan)" >
<param name="wlan_interface_24G" type="string" value="wlx801f02c608aa" />
<param name="wlan_interface_2G4" type="string" value="wlx801f02c608aa" />
<param name="wlan_interface_5G" type="string" value="wlx801f02c608aa" />
<node pkg="wlan_pioneer" name="wlanSignal" type="wlanSignal" />
</group>

View file

@ -1,3 +1,3 @@
time timestamp
int8 level_24G
int8 level_2G4
int8 level_5G

View file

@ -46,14 +46,14 @@ int8_t getWlanSignalStrength(const string &interface) {
int main(int argc, char **argv) {
init(argc, argv, "wlanSignal");
NodeHandle node;
string wlanInterface24G;
string wlanInterface2G4;
string wlanInterface5G;
if (node.param<string>("wlan_interface_24G", wlanInterface24G, "wlan0")) {
ROS_INFO("Param wlan_interface_24G: %s", wlanInterface24G.c_str());
if (node.param<string>("wlan_interface_2G4", wlanInterface2G4, "wlan0")) {
ROS_INFO("Param wlan_interface_2G4: %s", wlanInterface2G4.c_str());
}
else {
ROS_INFO("Param 'wlan_interface_24G' not set. Using 'wlan0'");
ROS_INFO("Param 'wlan_interface_2G4' not set. Using 'wlan0'");
}
if (node.param<string>("wlan_interface_5G", wlanInterface5G, "wlan0")) {
@ -70,10 +70,10 @@ int main(int argc, char **argv) {
while (ok()) {
WlanSignalMsg msg;
msg.timestamp = Time::now();
msg.level_24G = getWlanSignalStrength(wlanInterface24G);
msg.level_2G4 = getWlanSignalStrength(wlanInterface2G4);
msg.level_5G = getWlanSignalStrength(wlanInterface5G);
ROS_INFO("Signal strength 2.4G: %i Signal strength 5G: %i", msg.level_24G, msg.level_5G);
ROS_INFO("Signal strength 2.4G: %i Signal strength 5G: %i", msg.level_2G4, msg.level_5G);
publisher.publish(msg);
spinOnce();