0
$\begingroup$

Rosanswers logo

I would like to make a Subscriber on my Android-Application which can subscribe the batterydata from the robotino. These Data should be displayed on the apply. In this project i have two nodes which the predecessor make it. In one of then they subscribe the camera an, which I use the source code to hope they working for my extra function, but they show nothing. Here my Sourcecode for the subscription

@Override
public void onStart(ConnectedNode connectedNode) {
 // Battery Subscriber
    battery_subscriber = connectedNode.newSubscriber(GraphName.of(topic_basename + "battery_status"), std_msgs.Float64._TYPE);
    battery_subscriber.addMessageListener(new MessageListener<std_msgs.Float64>() {
        @Override
        public void onNewMessage(Float64 message) {
            batterystatus = callable.call(message);
        }
    });                                                                                                                                                                            public Float64 getBatterystatus() { return batterystatus;
}

In my MainActivity I call the "getBatterystatus" to receive the data from the battery:

    pTextBatteryStatus = (TextView) findViewById(R.id.robot_battery);
    pTextBatteryStatus.setText(String.valueOf(NodeTeleopPublisher.getBatterystatus()));

I publish some data but my app is crashing all the time. My Question is: How make a simple Subscriber for my Android-Application?


Edit: Thank you for your answer. I hope that is the errorlog what are your need. The app crash doesnt make some error. I think the problem is the part from the messageListener.

05-24 15:03:03.659 28077-28077/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:03.660 28077-28077/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:03.660 28077-28077/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:03.708 28077-28077/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:03.708 28077-28077/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:04.954 28092-28092/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:04.955 28092-28092/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:04.955 28092-28092/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:05.003 28092-28092/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:05.003 28092-28092/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:05.785 27146-27174/? E/ExternalAccountType: Unsupported attribute readOnly
05-24 15:03:05.785 27146-27174/? E/CSP_ExceptionCapture: Unsupported attribute readOnly
05-24 15:03:05.901 5459-5497/? E/LogCollectService: Level = 256
05-24 15:03:11.144 28104-28104/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:11.144 28106-28106/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:11.144 28106-28106/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:11.144 28104-28104/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:11.144 28106-28106/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:11.144 28104-28104/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:11.202 28106-28106/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:11.202 28104-28104/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:11.202 28106-28106/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:11.202 28104-28104/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:12.232 28123-28123/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:12.233 28123-28123/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:12.233 28123-28123/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:12.261 28123-28123/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:12.261 28123-28123/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:13.306 28137-28137/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:13.307 28137-28137/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:13.307 28137-28137/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:13.355 28137-28137/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:13.355 28137-28137/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:14.393 28148-28148/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:14.394 28148-28148/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:14.394 28148-28148/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:14.430 28148-28148/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:14.430 28148-28148/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:14.613 3723-3723/? E/Thermal-daemon: [charger_ic] temp_new :30  temp_old :29
Report temperature: [charger_ic] temp :30  report_threshold:1
05-24 15:03:14.615 3723-3723/? E/Thermal-daemon: [ap] temp_new :31  temp_old :30
Report temperature: [ap] temp :31  report_threshold:1
05-24 15:03:15.480 28159-28159/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:15.480 28159-28159/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:15.480 28159-28159/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:15.509 28159-28159/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:15.509 28159-28159/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:16.545 28174-28174/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:16.545 28174-28174/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:16.545 28174-28174/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:16.593 28174-28174/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:16.593 28174-28174/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:17.641 28185-28185/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:17.641 28185-28185/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:17.641 28185-28185/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:17.675 28185-28185/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:17.675 28185-28185/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:18.786 28196-28196/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:18.787 28196-28196/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:18.787 28196-28196/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:18.835 28196-28196/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:18.835 28196-28196/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:19.868 28207-28207/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:19.868 28207-28207/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:19.868 28207-28207/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:19.916 28207-28207/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:19.916 28207-28207/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:21.017 28218-28218/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:21.018 28218-28218/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:21.018 28218-28218/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:21.066 28218-28218/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:21.066 28218-28218/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:22.150 28229-28229/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:22.151 28229-28229/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:22.151 28229-28229/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:22.198 28229-28229/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:22.199 28229-28229/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:23.297 28240-28240/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:23.298 28240-28240/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:23.298 28240-28240/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:23.346 28240-28240/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:23.346 28240-28240/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:24.621 3723-3723/? E/Thermal-daemon: [pa_0] temp_new :30  temp_old :29
05-24 15:03:24.622 3723-3723/? E/Thermal-daemon: Report temperature: [pa_0] temp :30  report_threshold:1
05-24 15:03:24.625 3723-3723/? E/Thermal-daemon: [ap] temp_new :32  temp_old :31
Report temperature: [ap] temp :32  report_threshold:1
05-24 15:03:25.051 28252-28252/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:25.051 28252-28252/? E/memtrack: Couldn't load memtrack module (Invalid argument) 
05-24 15:03:25.052 28252-28252/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:25.100 28252-28252/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:25.100 28252-28252/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:26.449 28263-28263/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:26.450 28263-28263/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:26.450 28263-28263/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:26.487 28263-28263/? E/HAL: load: id=fm != hmi->id=fm
05-24 15:03:26.487 28263-28263/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:29.173 4771-4771/? E/HwSystemManager: HandleInstalledPackageInfoService:second action: pkgData is null
05-24 15:03:29.469 3717-3717/? E/installd: Couldn't opendir /data/app/vmdl2062235899.tmp: No such file or directory
05-24 15:03:29.734 27146-27174/? E/ExternalAccountType: Unsupported attribute readOnly
05-24 15:03:29.735 27146-27174/? E/CSP_ExceptionCapture: Unsupported attribute readOnly
05-24 15:03:29.811 4771-4771/? E/HwSystemManager: AppCleanUpService:msg is 1
05-24 15:03:29.825 27146-27174/? E/ExternalAccountType: Unsupported attribute readOnly
05-24 15:03:29.825 27146-27174/? E/CSP_ExceptionCapture: Unsupported attribute readOnly
05-24 15:03:29.843 5459-5497/? E/LogCollectService: Level = 256
05-24 15:03:29.871 28290-28303/? E/linker: readlink('/proc/self/fd/21') failed: Permission denied [fd=21]
warning: unable to get realpath for the library "/system/lib/hw/gralloc.hi3630.so". Will use given name.
05-24 15:03:29.874 28290-28303/? E/linker: readlink('/proc/self/fd/21') failed: Permission denied [fd=21]
warning: unable to get realpath for the library "libion.so". Will use given name.
05-24 15:03:29.876 28290-28303/? E/HAL: load: id=gralloc != hmi->id=gralloc
05-24 15:03:29.932 5459-5497/? E/LogCollectService: Level = 256
05-24 15:03:29.957 15993-22694/? E/NetworkScheduler: Unrecognised action provided: android.intent.action.PACKAGE_REMOVED
05-24 15:03:29.972 5262-5262/? E/HideAppsPagedView:  syncPages mCurrentPage = 0
05-24 15:03:29.980 5262-5262/? E/HideAppsPagedView:  syncAppsPageItems page = 0 mNumAppsPages = 1 mCurrentPage = 0
 createAddIcon count = 0
05-24 15:03:30.106 3702-3702/? E/SELinux: avc:  denied  { find } for service=batteryproperties scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:healthd_service:s0 tclass=service_manager
05-24 15:03:30.168 18810-20827/? E/HwSystemManager: PermissionDBAdapter:appcationsList size:164
05-24 15:03:30.187 18810-18810/? E/HwSystemManager: SecurityBroadcastReceiver:SecurityBroadcastReceiver the rainbow is not enabled!
05-24 15:03:30.201 4771-4771/? E/HwSystemManager: AppCleanUpService:msg is 0
05-24 15:03:30.202 18810-19119/? E/HwSystemManager: SpaceCleanReceiver:doPkgAdd pi is not valid permission
05-24 15:03:30.356 27876-27959/? E/GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
05-24 15:03:30.402 27876-27876/? E/Finsky: [1] com.google.android.finsky.wear.x.a(3): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
05-24 15:03:30.450 28286-28286/? E/HAL: load: couldn't find symbol HMI
05-24 15:03:30.451 28286-28286/? E/memtrack: Couldn't load memtrack module (Invalid argument)
05-24 15:03:30.451 28286-28286/? E/android.os.Debug: failed to load memtrack module: -22
05-24 15:03:30.479 28286-28286/? E/HAL: load: id=fm != hmi->id=fm   
05-24 15:03:30.479 28286-28286/? E/fm_if.c: find the id:fm and begins to open the devices
05-24 15:03:30.517 28334-28346/? E/linker: readlink('/proc/self/fd/21') failed: Permission denied [fd=21]
warning: unable to get realpath for the library "/system/lib/hw/gralloc.hi3630.so". Will use given name.
05-24 15:03:30.521 28334-28346/? E/linker: readlink('/proc/self/fd/22') failed: Permission denied [fd=22]
warning: unable to get realpath for the library "libion.so". Will use given name.
05-24 15:03:30.524 28334-28346/? E/HAL: load: id=gralloc != hmi->id=gralloc
05-24 15:03:30.711 28370-28386/com.example.teleoperation E/HAL: load: id=gralloc != hmi->id=gralloc
05-24 15:03:30.995 15993-19818/? E/NetworkScheduler: Unrecognised action provided: android.intent.action.PACKAGE_REPLACED
05-24 15:03:31.033 15993-16429/? E/NetworkScheduler.ATC: Trying to release unacquired lock: com.google.android.googlequicksearchbox/com.google.android.apps.gsa.tasks.BackgroundTasksGcmService
05-24 15:03:31.200 15993-16429/? E/ExecutionCriteria: Package unavailable for task: com.facebook.katana/com.facebook.api.feedcache.resync.NewsFeedCacheInvalidationGCMService{u=0 tag="NewsFeedCacheInvalidationGCMService" trigger=window{start=43200s,end=43230s,earliest=-23995075s,latest=-23995045s} requirements=[NET_CONNECTED] attributes=[PERSISTED] scheduled=-24038275s last_run=N/A jid=N/A status=PENDING retries=0 client_lib=MANCHEGO_GCM-0}
05-24 15:03:32.501 28411-28411/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:33.556 28415-28415/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:33.666 28417-28417/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:33.762 28420-28420/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:33.914 28422-28422/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:34.003 28424-28424/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:34.086 28427-28427/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:34.207 28430-28430/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:34.311 28432-28432/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:34.387 28434-28434/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:34.472 28436-28436/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/data@[email protected]@[email protected]: Permission denied
05-24 15:03:34.633 3723-3723/? E/Thermal-daemon: [ap] temp_new :33  temp_old :32
Report temperature: [ap] temp :33  report_threshold:1
05-24 15:03:34.956 4173-4210/? E/SensorHub: PS activate 1
05-24 15:03:34.971 3876-4217/? E/Parcel: Reading a NULL string not supported here.
Reading a NULL string not supported here.
05-24 15:03:34.995 4173-4531/? E/WifiStateMachine: allowFullBandScanAndAssociated:  enableAutoJoinWhenAssociated : disallow
05-24 15:03:35.001 4173-4531/? E/WifiConfigStore: updateConfiguration freq=2412 BSSID=ec:08:6b:16:70:3b RSSI=-47 "Robotino3AP"WPA_PSK
05-24 15:03:35.003 4173-4531/? E/native: do suspend false
05-24 15:03:35.053 4173-4564/? E/hwintelligencewifi:  DefaultState MSG_SCREEN_ON
05-24 15:03:35.268 28370-28442/com.example.teleoperation E/HAL: load: id=gralloc != hmi->id=gralloc
05-24 15:03:35.270 18810-18810/? E/HwSystemManager: MemCPUMonitor:startTimerMonitor isCompleted = true
05-24 15:03:35.803 4173-4531/? E/native: do suspend false
05-24 15:03:35.857 4173-4531/? E/HwWifiCHRStateManagerImpl: updateWifiIp  StateMachine 172.26.1.104
05-24 15:03:35.866 4173-4173/? E/hwintelligencewifi: NetworkInfo.State.CONNECTED
05-24 15:03:35.957 4173-4173/? E/SensorHub: PS activate 0
05-24 15:03:38.009 4173-4531/? E/WifiConfigStore: updateConfiguration freq=2412 BSSID=ec:08:6b:16:70:3b RSSI=-47 "Robotino3AP"WPA_PSK
05-24 15:03:39.354 4173-4559/? E/HwCHRWebMonitor: getFileResult throw exceptionjava.io.FileNotFoundException: proc/net/wifi_network_stat: open failed: ENOENT (No such file or directory)
05-24 15:03:39.636 3723-3723/? E/Thermal-daemon: [flash_led] temp_new :30  temp_old :29
05-24 15:03:39.637 3723-3723/? E/Thermal-daemon: Report temperature: [flash_led] temp :30  report_threshold:1
[ap] temp_new :34  temp_old :33
Report temperature: [ap] temp :34  report_threshold:1
05-24 15:03:40.559 15993-28471/? E/WakeLock: release without a matched acquire!
05-24 15:03:40.577 15993-28531/? E/WakeLock: release without a matched acquire!
05-24 15:03:41.015 4173-4531/? E/WifiConfigStore: updateConfiguration freq=2412 BSSID=ec:08:6b:16:70:3b RSSI=-47 "Robotino3AP"WPA_PSK
05-24 15:03:44.025 4173-4531/? E/WifiConfigStore: updateConfiguration freq=2412 BSSID=ec:08:6b:16:70:3b RSSI=-47 "Robotino3AP"WPA_PSK
05-24 15:03:44.050 4173-9609/? E/HsmCoreServiceImpl: onTransact in code is: 102
05-24 15:03:44.435 4173-9609/? E/HsmCoreServiceImpl: onTransact in code is: 102
05-24 15:03:44.497 3876-20315/? E/Parcel: Reading a NULL string not supported here.
Reading a NULL string not supported here.
05-24 15:03:44.514 19700-19725/? E/TotemWeather: WidgetUtils getWidgetShowCityInfo return myLocation
05-24 15:03:44.540 5262-5350/? E/HwLauncher: SettingsEx , no such field.
05-24 15:03:44.641 3723-3723/? E/Thermal-daemon: [flash_led] temp_new :31  temp_old :30
Report temperature: [flash_led] temp :31  report_threshold:1
05-24 15:03:47.055 4173-4531/? E/WifiConfigStore: updateConfiguration freq=2412 BSSID=ec:08:6b:16:70:3b RSSI=-47 "Robotino3AP"WPA_PSK
05-24 15:03:49.104 27876-27912/? E/PlayCommon: [22396] com.google.android.play.b.x.a(69): Failed to connect to server for server timestamp: java.net.UnknownHostException: Unable to resolve host "play.googleapis.com": No address associated with hostname
05-24 15:03:49.245 27876-27912/? E/PlayCommon: [22396] com.google.android.play.b.g.a(860): Failed to connect to server: java.net.UnknownHostException: Unable to resolve host "play.googleapis.com": No address associated with hostname
05-24 15:03:50.084 4173-4531/? E/WifiConfigStore: updateConfiguration freq=2412 BSSID=ec:08:6b:16:70:3b RSSI=-47 "Robotino3AP"WPA_PSK
05-24 15:03:53.111 4173-4531/? E/WifiConfigStore: updateConfiguration freq=2412 BSSID=ec:08:6b:16:70:3b RSSI=-45 "Robotino3AP"WPA_PSK

Originally posted by MarkusHHN on ROS Answers with karma: 54 on 2018-05-24

Post score: 0


Original comments

Comment by jubeira on 2018-05-24:
can you copy the error that is making the application crash here? How are you executing the node that has that code? The code of the node looks alright (see https://github.com/rosjava/rosjava_core/blob/kinetic/rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Listener.java).

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi! Can you update the question with the error that's making the app crash? Try debugging your app with ADB (see here for reference, you can see exactly what's going on with your app with it).

The code for the node looks OK. How are you executing it? Have you taken a look at https://github.com/rosjava/android_core/blob/kinetic/android_tutorial_pubsub/src/org/ros/android/android_tutorial_pubsub/MainActivity.java? Perhaps that can give you a hint.

I'd say the error is somewhere else. Use ADB and take a closer look to the error messages.

EDIT: note that you can copy the code in your question, not as an answer, please take into account that this is not a forum.

I just saw this line. What is this doing?

batterystatus = callable.call(message);

You should make batteryStatus just a plain double, and do

batteryStatus = message.getData();

Originally posted by jubeira with karma: 1054 on 2018-05-24

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by MarkusHHN on 2018-05-24:
i change the code and it isnt crashing but I dont received any data from the Subscriber.

Comment by jubeira on 2018-05-24:
Try adding some logs to the callback. Use https://github.com/rosjava/rosjava_core/blob/kinetic/rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Listener.java as a reference; log the value you get in the callback. Use rostopic info to check that the node has actually subscribed

Comment by MarkusHHN on 2018-05-24:
okay thanks i received the data but i cant pass over the data from the node to the RosActivity.

Comment by jubeira on 2018-05-24:
ok, we are getting there then. What if you log the value you get outside the node instead of setting it directly? What is NodeTeleopPublisher.getBatteryStatus returning?

Comment by MarkusHHN on 2018-05-28:
The NodeTeleopPublisher.getBatterystatus is zero. I checked the value "batterystatus" in the methode which is zero too. Do you know what is the problem?

Comment by jubeira on 2018-05-28:
Is your whole code public? perhaps if I can take a quick look at all of it I can give you more help. Are you printing the value that you are getting inside the callback? Is it something different from 0?

Comment by MarkusHHN on 2018-05-29:
No this whole code was made from a student on my university. I must make a additional function for the application. In the onNewMessage method i get the data, but in the getBetterystatus method i get zero.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.