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

vrosuser's profile - activity

2019-06-22 07:26:31 -0500 received badge  Famous Question (source)
2019-06-13 08:23:53 -0500 received badge  Famous Question (source)
2019-06-05 10:10:51 -0500 marked best answer Custom QT GUI in ROS for real time data freeze

Hi,

I am new to integrating ROS with QT. I am developing a custom gui to publish topic directly to a GUI that displays data in real time as it is read from a unit. I followed this link: http://wiki.ros.org/qt_create/Tutoria... .
GUI seems to work except it freezes after couple of minutes. Below is concept of how I have implemented.

 ---include/
               - main_winndow.hpp 
                -qnode.hpp`

---src/
  -main.cpp
  -main_winndow.cpp  => updates UI
  -qnode.cpp  => starts ros, reads ethernet packets from unit and publishes as "/raw_packets". Rawpacket is remapped to "input_data" in launch file and subscribed to functions call "msgrec" that decodes packets to topic parameters. I have 2 Q_EMIT. one to update ROS info in LIST-VIEW of UI and second Q_EMIT is after decoding of packets.

main_winndow.cpp

        :
        :
    MainWindow::MainWindow(int argc, char** argv, QWidget *parent)
        : QMainWindow(parent)
        , qnode(argc,argv)
    {
        :
        :
        // CONNECT GUI Button to Qnode init
        QObject::connect(ui.BUTTON, SIGNAL(clicked()), this, SLOT(StartqnodeInit()));

    // SIGNAL from Qnode after messages are read from unit to be displayed on GUI
        QObject::connect(&qnode, 
                         SIGNAL(logunitsmessages(std::string, std::string)), this, 
                         SLOT(ui_logunitsmessages(std::string, std::string)));


        // GUI List view gets updated after loggingUpdated signal from qnode
        ui.listView_log->setModel(qnode.loggingModel());
        QObject::connect(&qnode, SIGNAL(loggingUpdated()), this, SLOT(updateLoggingView()));

    }

    void MainWindow::StartqnodeInit()
    {        
        if ( !qnode.init(ui.lineEdit->text().toStdString()) ) {
          showNoMasterMessage();
        }
    }

    /*****************************************************************************
    ** GUI UPDATE HERE
    *****************************************************************************/   
    void MainWindow::updateLoggingView()   // LIST View updated here in signal loggingUpdated() from QNode 
    {
        ui.listView_log->scrollToBottom();
    }
    void MainWindow::ui_logunitsmessages( std::string msg1, std::string msg2 )
    {
    // LABELS updated here in signal logunitsmessages() from QNode 
         ui.msg1_valuelabel->setText(QString::fromStdString(msg1)); 
         ui.msg2_valuelabel->setText(QString::fromStdString(msg2));
    }
}

qnode.cpp

        :
            :
   // INIT
    bool QNode::init() {

    ros::init(init_argc,init_argv,"qexample");

    if ( ! ros::master::check() ) {
    return false;
    }
    ros::start(); // explicitly needed since our nodehandle is going out of scope.
    ros::NodeHandle n;


    pub_rawpack_ = n.advertise<custometh::ethpacket>("/raw_packets", 1, this);

    sub_rawpack_ = n.subscribe(input_data, 1, &QNode::msgrec, this); 

    pub_topicmsg_ = n.advertise<std_msgs::String>("/decodedmsg", 1);


    start();
    return true;
    }

     // RUN 
    void QNode::run() {
            ros::Rate loop_rate(10);
            /* loop until shut down or end of file */
            while(ros::ok() && rawpacketpolling())
            {
                pub_topicmsg_.publish(topicmessage);

            Q_EMIT logunitsmessages(topicmessage.msg1, topicmessage.msg2); // EMIT after messages is decoded.

                ros::spinOnce();
                loop_rate.sleep();
            }

            Q_EMIT rosShutdown(); // used to signal the gui for a shutdown (useful to roslaunch)  
    }

    msgrec ()
    {
    //code that decodes raw packets into "topicmessage" msg of std_msgs::String type
    }

    void QNode::log( const LogLevel &level, const std::string &msg) {
    : // some code here    
      Q_EMIT loggingUpdated(); // used to readjust the scrollbar
    }

I have read couple of posts that say to use QTime. Could someone help me how I can use Qtime in my example. If Qtime is not the right way to defreeze then what is the right method to go about to display real time topic without GUI freeze.

2019-05-30 08:36:58 -0500 received badge  Notable Question (source)
2019-05-30 08:36:58 -0500 received badge  Popular Question (source)
2019-05-06 16:21:37 -0500 asked a question Custom QT GUI in ROS for real time data freeze

Custom QT GUI in ROS for real time data freeze Hi, I am new to integrating ROS with QT. I am developing a custom gui to

2018-08-08 01:01:59 -0500 marked best answer Rviz robot model will not open via script

Without bash and python script: master and rviz works successfully

When I run "roscore" in first terminal. Master runs successfully

process[master]: started with pid [4355] ROS_MASTER_URI=http://userid:11311/

New terminal I type in "roslaunch /home/userid/catkin_ws/src/robot/launch/robot.launch". This basically open RVIZ with the robot model in grid successfully

Above steps are implemented as follows in bash and python script and it does NOT work.

##bashscript.sh

   source ~/.bashrc

 python pythonscript.py

##pythonscript.py

def init():
    os.system("gnome-terminal -e 'bash -c \"pwd; roslaunch /home/userid/catkin_ws/src/robot/launch/robot.launch; exec bash\"'")

if (__name__ == '__main__'):
    init()

This fails. RVIZ opens with a white blob in center on grid NOT the robot model. and left hand panel it says robot model error. status error.

Why rviz wouldn't work with script?

2018-08-08 01:00:54 -0500 received badge  Famous Question (source)
2017-11-06 18:52:49 -0500 marked best answer Point cloud Data analysis from ROS bag - Info required.

I am asking for information on how to proceed. I am fairly new to ROS environment.

I have ROS bag recorded data with point cloud topics (x,y,z,velocity,intensity). I have to perform analysis on this data.

  • First I have to extract Only the point cloud topics from Rosbag. Any suggestions on how to achieve this ?

  • Second take the extracted point cloud topics and be able to either plot or graph (x,y,z,velocity,intensity). Any suggestion on which software/language/platform is best to achieve this. ?

Appreciate all the help I can get here.

2017-11-06 18:51:54 -0500 received badge  Famous Question (source)
2017-10-03 09:27:19 -0500 received badge  Notable Question (source)
2017-10-03 09:26:38 -0500 received badge  Notable Question (source)
2017-07-14 02:13:38 -0500 received badge  Notable Question (source)
2017-07-13 11:03:01 -0500 received badge  Popular Question (source)
2017-06-29 08:05:07 -0500 commented answer Point cloud Data analysis from ROS bag - Info required.

Thank you in pointing me to right direction.

2017-06-29 08:04:26 -0500 received badge  Popular Question (source)
2017-06-29 08:04:15 -0500 commented answer Rviz robot model will not open via script

My plan was to include all launch cmds in python script. so user will have to simply run one python script, instead of d

2017-06-28 11:43:09 -0500 asked a question Point cloud Data analysis from ROS bag - Info required.

Point cloud Data analysis from ROS bag - Info required. I am asking for information on how to proceed. I am fairly new t

2017-06-28 08:18:19 -0500 asked a question Rviz robot model will not open via script

Rviz robot model will not open via script Without bash and python script: master and rviz works successfully When I run

2017-05-19 13:51:27 -0500 commented answer how to start master robot from my linux laptop

I tried ssh this time. I made mistake earlier of not using the "username" of robot PC while ssh robotpc@robotcompurterna

2017-05-19 13:51:02 -0500 answered a question how to start master robot from my linux laptop

I tried ssh this time. I made mistake earlier of not using the "username" of robot PC while ssh robotpc@robotcompurterna

2017-05-19 13:48:25 -0500 marked best answer how to start master robot from my linux laptop

Note: I am new to ROS . I am trying my level best to understand the tutorial and follow the instructions.

-- Robot ROS MASTER IP = 192.168.1.3

-- Linux Ubuntu 14.04 with ROS indigo installed IP address = 192.168.1.68

After editing hosts file and bashrc file in both Robot and Laptop to as per instructions given in http://nootrix.com/software/ros-netwo... . I was able to see topics and use RVIZ to see topics on my laptop. Ping between master and laptop is all good.

My question here is in above network setup. I still need to go into Robot and start roscore. Only then I will be able to see topics and the rest on my laptop.

What is the command or setup required such that . From my laptop terminal I should be able to start roscore/master inside Robot. Is there a way to do so.

Please help me .!

2017-05-19 13:48:25 -0500 received badge  Scholar (source)
2017-05-19 13:48:14 -0500 received badge  Popular Question (source)
2017-05-17 13:52:50 -0500 asked a question how to start master robot from my linux laptop

how to start master robot from my linux laptop Note: I am new to ROS . I am trying my level best to understand the tutor