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

Andrew Godley's profile - activity

2015-12-31 07:51:11 -0500 received badge  Famous Question (source)
2015-08-30 16:34:26 -0500 received badge  Notable Question (source)
2015-05-06 05:11:57 -0500 received badge  Popular Question (source)
2015-05-01 08:16:59 -0500 received badge  Enthusiast
2015-04-29 05:41:53 -0500 asked a question rosserial on arm prosessor

Hi I have a project where I use rosserial with an arduino, I have code that publishes messages from one arduino, connected to a pc, and another arduino that subscribes, connected to an Odroid XU3. I had to install rosserial on the Odroid using this method below due to the normal way not working with arm processors.

cd ~/
mkdir -p catkin_ws/src
cd catkin_ws/src/
catkin_init_workspace
cd ..
catkin_make
cd ~/catkin_ws/src/
git clone https://github.com/chuck-h/rosserial.git
cd rosserial/
git checkout hydro-devel
cd ~/catkin_ws
catkin_make install
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0

When I run the program the terminal returns this error.

: No such file or directory

This error has really confused me due to the lack of information it provides, has anyone come across this before

2015-04-24 12:26:56 -0500 received badge  Famous Question (source)
2015-04-24 07:12:07 -0500 commented answer Arduino To Linux in ROS

--(2/2)-- Reading state information... Done E: Unable to locate package ros-hydro-rosserial-arduino

2015-04-24 07:11:46 -0500 commented answer Arduino To Linux in ROS

The CPP code works. The error happens when I try to install the rostral libraries from the terminal onto my device (its kind of similar to a raspberry pi). The command is; sudo apt-get install ros-hydro-rosserial-arduino. which returns Reading package lists... Done Building dependency tree --(1/2)--

2015-04-24 05:21:28 -0500 received badge  Notable Question (source)
2015-04-24 04:54:05 -0500 commented question Arduino To Linux in ROS

Thanks, i am new to ubuntu and ROS so it been a difficult. I have used the ROS serial libraries and i can access the arduino from a desktop perfectly. But when trying to install on the odroid i get Unable to locate package ros-hydro-rosserial-arduino i don't know why since this code worked on the PC

2015-04-22 09:56:45 -0500 received badge  Popular Question (source)
2015-04-22 04:20:06 -0500 asked a question Arduino To Linux in ROS

Hi I am using a wii nunchuck controller to pass serial values to my Ubuntu Computer, I wrote a c++ file that carries out this function and it works perfectly, however I have tried making this in ROS where rather than print the value to the terminal I publish it to a topic. I cannot get my package to build in ROS and I dont know why. I have never used a ROS file before where i have had to include header files so i could have done this incorrectly, the headers are in ws/src/pakage/include. The error which i think is the main one is.

/home/satellite/sendws/src/nunout/src/serialin.cpp:57:14: error: ambiguous overload for ‘operator>>’ in ‘file >> ss’

My code for the program which runs as a standard executable is.

#include <iostream>
#include <stdio.h>
#include <fstream>
#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

using namespace std;

int
main()
{
    struct termios tio;

    memset(&tio,0,sizeof(tio));
    tio.c_iflag=0;
    tio.c_oflag=0;
    tio.c_cflag=CS8|CREAD|CLOCAL;
    tio.c_lflag=0;
    tio.c_cc[VMIN]=1;
    tio.c_cc[VTIME]=5;

    cfsetispeed(&tio, B9600);


    int i;
    string str;
cout << "START OF PROG";

fstream file;

file.open("/dev/ttyACM0");

if(file!=NULL){
      cout << "file not null" << endl;  
    for(i=0;i<1000;i++){

      file >> str;
      if(str == ""){cout<< "null"<<endl;}
      else{cout<<str<<endl;}

  }
      //fclose(file);
}
else {cout<<"file null"<<endl;}
}

when it is in ROS the code has been changed to //Take nunchuck position from arduino //over serial and broadcast it to //topic for Odroid

     #include <stdio.h>
     #include <fstream>
     #include <termios.h>
     #include <unistd.h>
     #include <fcntl.h>
     //#include <string.h>

     #include "ros/ros.h" 
     #include "std_msgs/String.h"

     using namespace std;

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

        ros::init(argc, argv, "serialin");
        ros::NodeHandle n;
        ros::Publisher nunpos_pub = n.advertise<std_msgs::String>("nunpos",1);
        ros::Rate loop_rate(1);

     //==================================================== 


        struct termios tio;

        memset(&tio,0,sizeof(tio));
        tio.c_iflag=0;
        tio.c_oflag=0;
        tio.c_cflag=CS8|CREAD|CLOCAL;
        tio.c_lflag=0;
        tio.c_cc[VMIN]=1;
        tio.c_cc[VTIME]=5;

        cfsetispeed(&tio, B9600);


        int i;
        string str;

        fstream file;

        file.open("/dev/ttyACM0");

     if(file!=NULL){
        while(ros::ok()){

                  std_msgs::String msg;
                  std::stringstream ss;

                  file >> ss;

                  if(ss == ""){
                          ss = "Empty";
                          msg.data = ss.str();
                          ROS_INFO("%s", msg->data.c_str());
                      }
                  else{

                        msg.data = ss.str();
                        nunpos_pub.publish(msg);                  

                      }

            loop_rate.sleep();


            }

     return 0;
            }
        }

the output from the catkin_make is

satellite@satellite-OptiPlex-990:~/sendws$ catkin_make
Base path: /home/satellite/sendws
Source space: /home/satellite/sendws/src
Build space: /home/satellite/sendws/build
Devel space: /home/satellite/sendws/devel
Install space: /home/satellite/sendws/install
####
#### Running command: "make cmake_check_build_system" in "/home/satellite/sendws/build"
####
####
#### Running command: "make -j4 -l4" in "/home/satellite/sendws/build"
####
[100%] Building CXX object nunout/CMakeFiles/serialin.dir/src/serialin.cpp.o
/home/satellite/sendws/src/nunout/src/serialin.cpp: In function ‘int main(int, char**)’:
/home/satellite/sendws/src/nunout/src/serialin.cpp:57:14: error: ambiguous overload ...
(more)