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

Tav_PG's profile - activity

2022-01-24 08:46:42 -0500 received badge  Famous Question (source)
2022-01-24 08:46:42 -0500 received badge  Notable Question (source)
2020-05-14 02:56:50 -0500 received badge  Taxonomist
2020-04-05 17:53:09 -0500 marked best answer class sensor_msgs.CompressedImage, unresolved supertypes: org.ros.internal.message.Message> Task:app:buildInfoGeneratorDebug

I can't compile my Android Kotlin Project because I get the following 'Kotlin compiler' error when gradle compiles:

Supertypes of the following classes cannot be resolved. Please make sure 
you have the required dependencies in the classpath: class 
sensor_msgs.CompressedImage, unresolved supertypes: 
org.ros.internal.message.Message> Task:app:buildInfoGeneratorDebug

This is a simple test project that has the bare minimum code using http://wiki.ros.org/shield_teleop as a boilerplate. I removed the joystick code but left the camera code.

A am using ROS Kinetic Ubuntu on the robot, Android 8.0 on the app.

Manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools" package="com.company.roscameratest">

    <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme" tools:replace="android:icon">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name="org.ros.android.MasterChooser" />

        <service android:name="org.ros.android.NodeMainExecutorService" >
            <intent-filter>
                <action android:name="org.ros.android.NodeMainExecutorService" />
            </intent-filter>
        </service>
    </application>

</manifest>

build.gradle (Project):

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.41'
    repositories {
        google()
        jcenter()
 }

dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle (Module):

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.company.roscameratest"
        minSdkVersion 26
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    configurations.all {
        resolutionStrategy.force "org.ros.android_core:android_15:0.3.3"
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'org.ros.android_core:android_15:0.3.3'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    //androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

repositories {
    maven {  url 'https://github.com/rosjava/rosjava_mvn_repo/raw/master' }
}
2020-04-05 17:52:51 -0500 marked best answer ROS Services working with ROSJava on Android

I have written an Android app. to control a squad of robots using ROSJava. I can create nodes, publish and subscribe to ROS topics, but I am having difficulty in connecting to ROS Services.

I have created a working simple ROS service (client and server) in C++ on ROS Kinetic on the robots (Ubuntu). Now I want to leave the server ROS service on the robot (C++|ROS|Ubuntu) and move the client ROS service onto the Android app. (Kotlin|ROSJava|Windows) that controls to robot.

I have followed the same code structure as best I can in the documentation:

http://rosjava.github.io/rosjava_core...

, and also the rosjava_tutorial_services at:

https://github.com/rosjava/rosjava_co... (but converted from Java to Kotlin).

In my Kotin code, I am missing the part where I compile my equivalent..

rosjava_test_msgs.AddTwoIntsRequest, rosjava_test_msgs.AddTwoIntsResponse

for ServiceClient (and request object), and...

rosjava_test_msgs.AddTwoInts._TYPE

for connectedNode.newServiceClient

Server Code (C++ on ROS Ubuntu)

#include "ros/ros.h"
#include "android_listener/ControlOwner.h"
#include <cstdlib>
#include <string>
#include <iostream>

using namespace std;

string owner = "0.0.0.0";

bool getOwner(  android_listener::ControlOwner::Request &req,
                android_listener::ControlOwner::Response &res) {

    if (req.mode == "?" || req.mode == "?.?.?.?") {
        res.ipaddress = owner;
    } else {
        if (owner == "0.0.0.0" || req.mode == "0.0.0.0") {
            owner = req.mode.c_str();
            res.ipaddress = owner;
        } else {
            res.ipaddress = owner;
        }
    }
    return true;

}

int main(int argc, char **argv) {

    ros::init(argc, argv, "ownership_server");
    ros::NodeHandle nh;
    ros::ServerServer serviceOwner = nh.advertiseService("ownership", getOwner);
    ROS_INFO("Ownership Service is Ready!");

    ros::spin();

    return 0;
}

Client Code (Kotlin on ROSJava Windows)

import org.ros.exception.RemoteException
import org.ros.exception.RosRuntimeException
import org.ros.exception.ServiceNotFoundException
import org.ros.namespace.GraphName
import org.ros.node.AbstractNodeMain
import org.ros.node.ConnectedNode
import org.ros.node.NodeMain
import org.ros.node.service.ServiceClient
import org.ros.node.service.ServiceResponseListener
import android_listener.OwnershipRequest    // Error!
import android_listener.OwnershipResponse   // Error!

/**
 * Client ROS Service
 *
 *  Adapted from: https://github.com/rosjava/rosjava_core/blob/kinetic/rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Client.java
*  @original_author damonkohler@google.com (Damon Kohler)
*/
class SrvClient : AbstractNodeMain() {

    override fun getDefaultNodeName(): GraphName {
        return GraphName.of("ownership_client_test")
    }

    override fun onStart(connectedNode: ConnectedNode?) {
        val serviceClient: ServiceClient<android_listener.OwnershipRequest, android_listener.OwnershipResponse> // Error!
        try {
            serviceClient = connectedNode!!.newServiceClient<OwnershipRequest, OwnershipResponse>("ownership", android_listener.Ownership._TYPE)    // Error!
        } catch (e: ServiceNotFoundException) {
            throw RosRuntimeException(e)
        }

        val request = serviceClient.newMessage()
        request.mode = "?.?.?.?"
        serviceClient.call(request, object : ServiceResponseListener<android_listener.OwnershipResponse> {  // Error!
                override fun onSuccess(response: android_listener.OwnershipResponse) {  // Error!
                    connectedNode.log.info(
                            String.format("%d = %d", request.mode, response.ipaddress))
                }

                override fun onFailure(e: RemoteException) {
                    throw RosRuntimeException(e)
                }
        })
    }
}

So my question is how to I get the android_listener.OwnershipRequest and android_listener.OwnershipResponse dependences from C++ ROS on Ubuntu to Kotlin ROSJava on Android Stuidio (Windows)? Have I missed a step in the documentation? Does anyone know a youTube tutorial on this?

2020-04-05 17:52:51 -0500 received badge  Scholar (source)
2020-04-05 17:52:01 -0500 received badge  Famous Question (source)
2020-02-18 14:32:25 -0500 received badge  Necromancer (source)
2020-02-18 14:32:25 -0500 received badge  Self-Learner (source)
2020-02-18 14:32:25 -0500 received badge  Teacher (source)
2020-01-06 02:14:28 -0500 marked best answer could not find any instance of Visual Studio.

Goal:I intend to install ROS2 Dashing on Windows. I am building from source following the instructions in https://index.ros.org/doc/ros2/Instal....

Issue: When running colcon build --merge-install from the Visual Studio Developer Command Prompt each package starts to be built. However, it fails on the same error:

--- stderr: <package>
CMake Error at CMakeLists.txt:2 (project):
  Generator

    Visual Studio 16 2019

  could not find any instance of Visual Studio.

I have added an AMENT_IGNORE file to each package to see if the problem is with an individual package, but the error is occuring in every package.

Thank you in advance for any assistance.

2020-01-05 18:48:16 -0500 answered a question could not find any instance of Visual Studio.

Apology: Firstly I would like to apologise, I'm under some pressure to get ROS2 installed on Windows, and I am posting s

2019-11-10 05:54:46 -0500 received badge  Popular Question (source)
2019-10-21 08:17:34 -0500 received badge  Famous Question (source)
2019-10-09 19:53:48 -0500 commented question QtCreator + ROS error: expected ‘:’ before ‘slots’

You added the ros2 tag to this question, yet the tutorial you are following (https://www.bbsmax.com/A/RnJW7r6wJq/) is f

2019-10-09 19:53:40 -0500 commented question QtCreator + ROS error: expected ‘:’ before ‘slots’

You added the ros2 tag to this question, yet the tutorial you are following (https://www.bbsmax.com/A/RnJW7r6wJq/) is fo

2019-10-09 19:47:31 -0500 received badge  Notable Question (source)
2019-10-04 06:21:55 -0500 received badge  Famous Question (source)
2019-10-04 06:21:55 -0500 received badge  Notable Question (source)
2019-10-04 06:21:55 -0500 received badge  Popular Question (source)
2019-10-02 23:38:17 -0500 received badge  Supporter (source)
2019-10-02 23:34:44 -0500 commented question ROS2 Multicast not working between remote pc's?

Can you ping each way?

2019-10-02 19:26:02 -0500 asked a question could not find any instance of Visual Studio.

could not find any instance of Visual Studio. Goal: I intend to install ROS2 Dashing on Windows. I am building from sou

2019-10-02 18:42:39 -0500 commented question I am having an error while running roscore on windows.

Are you trying to run ROS1 Melodic on Windows? Are you following any instructions, if so, please provide a link to the

2019-10-02 17:53:31 -0500 commented question I am having an error while running roscore on windows.

Are you trying to run ROS1 Melodic on Windows? Are you following any instructions, if so, please provide a link to the

2019-10-02 00:13:06 -0500 answered a question The term 'python' is not recognized ROS2 Dashing Windows

Resolved: I manually downloaded and installed Python for Windows and all was good.

2019-10-02 00:13:06 -0500 received badge  Rapid Responder (source)
2019-10-01 22:43:54 -0500 asked a question The term 'python' is not recognized ROS2 Dashing Windows

The term 'python' is not recognized ROS2 Dashing Windows I am following the instructions at https://index.ros.org/doc/ro

2019-09-25 22:16:15 -0500 commented answer ROS2 Talker cannot communicate with Listener

Also note, the same symptoms (i.e. ROS2 Talker cannot communicate with Listener) occur if the computer has no network co

2019-09-11 23:16:53 -0500 commented answer how to report master connection status in android

All the above links are now dead. Does anyone know where they have moved to?

2019-09-11 21:23:28 -0500 commented question ROS Battery Status

Check out https://www.instructables.com/id/1S-6S-Battery-Voltage-Monitor-ROS/

2019-08-24 08:18:48 -0500 received badge  Notable Question (source)
2019-08-11 23:47:41 -0500 answered a question class sensor_msgs.CompressedImage, unresolved supertypes: org.ros.internal.message.Message> Task:app:buildInfoGeneratorDebug

I have since resolved this issue. It is not completely a ROS issue. I had found the issue was when I changed from AppC

2019-08-08 18:15:32 -0500 received badge  Notable Question (source)
2019-08-08 18:15:32 -0500 received badge  Popular Question (source)
2019-08-08 18:14:40 -0500 received badge  Popular Question (source)
2019-07-23 04:07:03 -0500 received badge  Popular Question (source)
2019-07-22 18:12:25 -0500 asked a question class sensor_msgs.CompressedImage, unresolved supertypes: org.ros.internal.message.Message> Task:app:buildInfoGeneratorDebug

class sensor_msgs.CompressedImage, unresolved supertypes: org.ros.internal.message.Message> Task:app:buildInfoGener

2019-07-21 23:03:49 -0500 asked a question Error: Program type already present: android.support.v4.os.ResultReceiver

Error: Program type already present: android.support.v4.os.ResultReceiver I have a build an Android app. to control a ro

2019-07-21 20:52:28 -0500 edited answer Error building Android app with rosjava

Try and replace: compile 'org.ros.rosjava_core:rosjava:0.1.+' with: compile 'org.ros.rosjava_core:rosjava:0.3.6' a

2019-07-21 20:52:28 -0500 received badge  Editor (source)
2019-07-18 18:16:10 -0500 commented question Heartbeat-bond: being aware of aliveness of other nodes

I was very relieved to have found this question, as it is exactly the question I'm asking. However, there is no answer!

2019-07-18 17:11:42 -0500 edited question Checking for network loss on TCPROS node

Checking for network loss on TCPROS node I have an android app. running ROSJava which upon connecting to a robot (Ubuntu

2019-07-18 01:19:16 -0500 answered a question Error building Android app with rosjava

Try and replace: compile 'org.ros.rosjava_core:rosjava:0.1.+' with: compile 'org.ros.rosjava_core:rosjava:0.3.6' a

2019-07-18 01:16:17 -0500 asked a question Checking for network loss on TCPROS node

Checking for network loss on TCPROS node I have an android app. running ROSJava which upon connecting to a robot (Ubuntu

2019-07-10 00:20:19 -0500 received badge  Enthusiast
2019-07-08 18:46:51 -0500 asked a question ROS Services working with ROSJava on Android

ROS Services working with ROSJava on Android I have written an Android app. to control a squad of robots using ROSJava.

2019-07-03 02:27:43 -0500 commented question Rosjava subscriber doesn't get any data

I do not have a solution but have you... [1] ..run a 'IsPortOpen' before the error exception. [2] ...called addMessageL