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

Intergrating IOIO with android_core

asked 2012-12-17 14:06:32 -0500

updated 2014-01-28 17:14:37 -0500

ngrennan gravatar image

Hi All

I've been trying to intergrate IOIO for android with ROS Android, to provide a readily available IO platform that can talk with ROScore. My main method is to communicate to an IOIO service by binding my node (as implments NodeMain) to the service and calling service functions from there.

In this case the class implementing NodeMain is the client.

I am however having trouble implementing the Intent as I'm not sure what context to use eg:

public class HMM_Interface_node implements NodeMain {

    short despos1, despos2, despos3, despos4, despos5, despos6, despos7;
    HMM_Interface_service mService;
    boolean mBound = false;

  public HMM_Interface_node(Context context) {

        this.context= context;

        }

then later on:

public void onStart(final ConnectedNode node) 
      {

    Intent intent = new Intent(this.context, HMM_Interface_service.class);

    mService.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);

I am thinking that HMM_Interface_node does not pass any context being only a class. Therefore I've been passing the ROSActivity context of the main activity to this. However when I run, my bindService throws a null pointer exception. I have checked all the fields of bindService and they are not null.

Unfortunately I can only find examples of binding services where the context for the intent comes directly from the main class which usually extends Activity. However in this case the NodeMainExecutorService is running multiple threads, this being one.

Any help would be appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-12-27 11:11:44 -0500

updated 2012-12-27 11:13:09 -0500

As suggested by trinighost the detail below has been answered in its own question located How to use IOIO with android_core

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-12-17 14:06:32 -0500

Seen: 721 times

Last updated: Dec 20 '12