ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

android_core widgets take a large portion of tablet CPU

asked 2012-06-28 09:24:02 -0500

virgil93 gravatar image

updated 2012-06-28 09:43:21 -0500

I am using a Samsung Galaxy Tab 8.9 to develop on. I am using the following android_core components:

  • CameraControlLayer
  • LaserScanLayer
  • PosePublisherLayer
  • RobotLayer
  • RosImageView
  • VirtualJoystickView

Even when not connected to the robot and therefore not receiving LiDAR and video I get almost a 40% CPU utilization (as seen by top in adb shell) when moving the Joystick around. This by itself isn't a problem but when connected this causes the app to jump above 100% and become incredibly laggy. I tried removing all other layers and Views, just leaving the Joystick and I still got the same utilization. I ran traceview and the majority of the calls seem to be originating in the measure/OnMeasure method calls of the VirtualJoystickView ( and sub components). I tried the following:

  1. overriding onMeasure in VirtualJoystickView but either had no change to the CPU or the view wouldn't show up at all. I'm sure I was doing something wrong but due to time constraints I had to abandon it. I think part of the problem is that the VirtualJoystickView which inherits from RelativeLayout only has one child (a relativeLayout) where I would expect it to have all of the different components of VirtualJoystickView (the thumb divets, etc). Especially, given this line in VirtualJoystickView.initVirtualJoystick,

        LayoutInflater.from(context).inflate(R.layout.virtual_joystick, this, true);
    that I think means take the root RelativeLayout in the xml file and this object becomes the root in it's place.

  2. I tried removing the different components of the Layout to see if less components resulted in less CPU utilization. This didn't show any drop until there was no moving component. In other words, just the grey ring.

I was wondering if there was any profiling done on the android_core layers and views to measure the CPU utilization?

Also, what device(s) were these components tested on?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-07-02 23:02:11 -0500

damonkohler gravatar image

I've only recently started looking at performance on Android. Please file issues ( when you find things like this and include any patches you've made to address the problem.

The teleop tutorial has mostly been used on Xooms.

I have not looked at this problem specifically yet. I've created an issue. Feel free to star it so that you will be notified when it is addressed.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-06-28 09:24:02 -0500

Seen: 232 times

Last updated: Jul 02 '12