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

Azhar's profile - activity

2022-08-07 04:19:57 -0500 received badge  Taxonomist
2019-03-27 07:13:30 -0500 received badge  Favorite Question (source)
2019-03-19 07:30:36 -0500 received badge  Self-Learner (source)
2019-03-19 07:30:36 -0500 received badge  Teacher (source)
2018-09-28 20:29:13 -0500 marked best answer dynamic_reconfigure tutorial problems

Hi everyone i am stilll new here so please assist me.

So i have been trying to make a gui to change the modes(manual, teleoperation) of an vehicle from a control station.

I initially tried to do qt and tried to integrate into ROS, but i failed ;(.

I came across these rqt plugin, dynamic_reconfigure, which would able to do the same thing as my gui.

When i created the following files according to the tutorial: http://wiki.ros.org/dynamic_reconfigu... .

These are the following problems/enquiry i have:

1) In the section "How to Write Your First .cfg File" --> "Use the cfg File"

#add dynamic reconfigure api
#find_package(catkin REQUIRED dynamic_reconfigure)
generate_dynamic_reconfigure_options(
cfg/Tutorials.cfg
#...
)

# make sure configure headers are built before any node using them
add_dependencies(example_node ${PROJECT_NAME}_gencfg)

What does the example_node refers to? should i change the example_node to the node which i want to change parameters/send signals?

For example, if i want to send commands to turtlesim_node, should i replace the example_node with turtlesim_node?

2) When i compile after creating the files according to the tutorial, i get the following error.

    CMake Error at dynamic_tutorials/CMakeLists.txt:59 (add_dependencies):
    Cannot add target-level dependencies to non-existent target "example_node".

    The add_dependencies works for top-level logical targets created by the
    add_executable, add_library, or add_custom_target commands.  If you want to
    add file-level dependencies see the DEPENDS option of the add_custom_target
    and add_custom_command commands.


    -- Configuring incomplete, errors occurred!
    See also "/home/azhar/catkin_ws/build/CMakeFiles/CMakeOutput.log".
    See also "/home/azhar/catkin_ws/build/CMakeFiles/CMakeError.log".  
    make: *** [cmake_check_build_system] Error 1
    Invoking "make cmake_check_build_system" failed

Please refer below for my following folders and let me know if i am missing something

CMakeLists.txt

       cmake_minimum_required(VERSION 2.8.3)
       project(dynamic_tutorials)

       find_package(catkin REQUIRED COMPONENTS
        dynamic_reconfigure
        roscpp
        rospy
        )

        #add dynamic reconfigure api

        ## Generate dynamic reconfigure parameters in the 'cfg' folder
       generate_dynamic_reconfigure_options(
       cfg/Tutorials.cfg
        )

        ###################################
         ## catkin specific configuration ##
        ###################################
        catkin_package(
        INCLUDE_DIRS include
         LIBRARIES dynamic_tutorials
         CATKIN_DEPENDS dynamic_reconfigure roscpp rospy
         DEPENDS system_lib
          )

        ###########
        ## Build ##
         ###########

        include_directories(
         ${catkin_INCLUDE_DIRS}
         )

        ## Declare a C++ library
        # add_library(dynamic_tutorials
        #   src/${PROJECT_NAME}/dynamic_tutorials.cpp
        # )

        ## Add cmake target dependencies of the library
        ## as an example, code may need to be generated before libraries
        ## either from message generation or dynamic reconfigure
        #add_dependencies(dynamic_tutorials ${${PROJECT_NAME}_EXPORTED_TARGETS}                       ${catkin_EXPORTED_TARGETS})

        ## Declare a C++ executable
        # add_executable(dynamic_tutorials_node src/dynamic_tutorials_node.cpp)


       ## Add cmake target dependencies of the executable
       ## same as for the library above
       # add_dependencies(dynamic_tutorials_node ${${PROJECT_NAME}_EXPORTED_TARGETS}             ${catkin_EXPORTED_TARGETS})

       ## Specify libraries to link a library or executable target against
       # target_link_libraries(dynamic_tutorials_node
       #   ${catkin_LIBRARIES}
       ## )

       # make sure configure headers are built before any node using them
       add_dependencies(example_node ${PROJECT_NAME}_gencfg)

Tutorials.cfg

       #!/usr/bin/env python
       PACKAGE = "dynamic_tutorials"

       from dynamic_reconfigure.parameter_generator_catkin import *

       gen = ParameterGenerator()

       gen.add("int_param",    int_t,    0, "An Integer parameter", 50,  0, 100)
       gen.add("double_param", double_t, 0, "A double parameter",    .5, 0,   1)
       gen.add("str_param",    str_t,    0, "A string parameter",  "Hello World")
       gen.add("bool_param",   bool_t,   0, "A Boolean parameter",  True)

       size_enum = gen.enum([ gen.const("Small",      int_t, 0, "A small constant"),
                   gen.const("Medium",     int_t, 1, "A medium constant"),
                   gen ...
(more)
2018-06-10 10:10:50 -0500 received badge  Notable Question (source)
2018-06-10 10:10:50 -0500 received badge  Famous Question (source)
2018-06-10 10:10:50 -0500 received badge  Popular Question (source)
2018-03-27 14:59:28 -0500 received badge  Famous Question (source)
2018-03-23 09:49:51 -0500 received badge  Famous Question (source)
2018-03-23 09:35:31 -0500 received badge  Student (source)
2018-03-08 04:35:11 -0500 received badge  Famous Question (source)
2018-02-28 20:30:36 -0500 marked best answer Creating rqt plugin

this is my package: https://github.com/azhar92/GUI-for-AV...

When I open rqt and try to open the plugin from the drop-down menu using the following steps

cd ~/catkin_ws
catkin_make
source ~/catkin_ws/devel/setup.bash
rqt --force-discover

I can see the name of my package when in the rqt gui, but when i click it,

I get the following error in the terminal output:

[ERROR] [1482121854.496133919]: Failed to load nodelet [rqt_test1/MyPlugin_1] of type [rqt_test1/MyPlugin]: MultiLibraryClassLoader: Could not create object of class type rqt_test1::MyPlugin as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
RosPluginlibPluginProvider::load_explicit_type(rqt_test1/MyPlugin) failed creating instance
PluginManager._load_plugin() could not load plugin "rqt_test1/MyPlugin": RosPluginlibPluginProvider.load() could not load plugin "rqt_test1/MyPlugin"

i think it has to do with the registration of the plugin. any form of guidance will be helpful. Thank you.

Plugin.xml : https://github.com/azhar92/GUI-for-AV...

Code:

<library path="lib/librqt_test1">

 <class name="rqt_test1/MyPlugin" type="rqt_test1::MyPlugin" base_class_type="rqt_gui_cpp::Plugin">

   <description>

4 buttons to switch between 4 different modes.

</description>

 <qtgui>

  <group>

   <label>Visualization</label>

    <statustip>Plugins related to visualization.</statustip>

  </group>

 <label>test1</label>

 <statustip>4 buttons to switch between 4 different modes.</statustip>

 </qtgui>

</class>

</library>
2017-09-13 01:13:36 -0500 marked best answer How to turn existing Qt widgets into rqt plugin?

i have been trying to read all the forums and tutorials , but i dont know where to start. Please guide this noob.

so there are two parts to my question.

i want to make a custom rqt plugin using Qt 5.7. I have already created the user interface in Qt 5.7. so how can i integrate it into ROS(so that it appears as one of the rqt plugins)

a) i have went through the tutorial of how to create a cpp rqt plugin . I dont know what to do after i create all the files(Cmakelist.txt, package.xml, plugin.xml, my_plugin.cpp, my_plugin.h). What to do after that? how can i ensure i can see the rqt plugin in the rqt plugin list. Am i missing anything?

b) this user interface is actually for a moving vehicle(teleoperation). How to use callback/Signal and Slot function to ensure i can communicate(send commands ) via the user interface?

#in Qt, when i click New project -> Import project,i cant see Import ROS project. i tried to run Qt thru terminal but to no avail.

Anyone who could at least guide about how to do would be very beneficial to me. Thank you.

2017-06-24 02:50:19 -0500 received badge  Notable Question (source)
2017-06-13 11:54:39 -0500 received badge  Notable Question (source)
2017-06-02 04:42:08 -0500 received badge  Famous Question (source)
2017-05-13 07:28:10 -0500 received badge  Famous Question (source)
2017-05-13 07:28:03 -0500 received badge  Famous Question (source)
2017-03-31 14:35:31 -0500 received badge  Notable Question (source)
2017-03-31 12:27:26 -0500 received badge  Popular Question (source)
2017-03-24 01:51:29 -0500 asked a question Navigation (Sending 2d goals to any part of the map)

Currently, the mobile robot works by navigating from station to station, autonomously.

I want to make the mobile robot travel to any point i point it to (the 2D Navigation goal in RVIZ).

May i know what changes i should do to make this work?

I am new to Navigation , so any guidance would be appreciated!

I have looked through the tutorials, but i dont know where to start http://wiki.ros.org/navigation/Tutori...

2017-03-22 08:22:20 -0500 answered a question how to save the displaying map and plotted data in rviz on an image file
2017-03-22 07:43:45 -0500 commented answer rqt freezes

it froze again when i open image_view in rqt too. However, when i open both the map and image(theora) from Rviz it works fine. :)

Do take note that i am using to view all this from a slave machine.

Currently, when i try to visualize the Laserscans in RVIZ alone, it freezes. Debugging in progess!

2017-03-20 13:29:14 -0500 received badge  Popular Question (source)
2017-03-20 10:57:22 -0500 answered a question Can see topic published but cannot see anything when we echo the topic

I solved the issue by downloading the LIDAR MAP(.yaml ) in my laptop and run from there. Thanks people. I encountered a new problem which i will be opening a new question on.

2017-03-17 11:54:41 -0500 answered a question navigation stack build errors

TRY THIS.

 sudo apt-get install ros-indigo-bfl
2017-03-17 03:44:58 -0500 commented question Can see topic published but cannot see anything when we echo the topic

ok.

A : Control station, my laptop B: mobile robot

in A,

export ROS_IP=<IP address of A>

export ROS_MASTER_URI=http://<IP address of B>:11311/

in B (MASTER),

export ROS_IP=<IP address of B>
roscore
2017-03-16 22:22:26 -0500 asked a question Can see topic published but cannot see anything when we echo the topic

I am working on a tele-operation mode of a mobile robot, from a control station.

The control station and the robot is connected to the same WIFI network and both can ping to each other.

The problem comes when i want to see the LIDAR map/readings on the control station.

When i rostopic list on my control station, i could see the topic. However, when I echo that topic, i didn't receive any message. When i open RViz and add the map , it doesn't show anything(because the message wasn't received in the first place). RViz freezes too when i try to add the map. This does not happens to the other topics. For eg, the topic odom can be echo-ed.

I tried with Ethernet , it works(but it has its own issues ), but i need to be connected through a same WIFI network.

What could be the problem here??

1) Too much data being published?(when i do a rostopic echo in the vehicle, my screen would be flooded with values)

2) WIFI connection? (i set up a bidirectional networking by exporting ROS_IP and ROS_MASTER_URI, do i have to do anything else?)

3) RViz issues? (it freezes, turns grey when i try )

4) Any other things i am missing out?

and possible solution for this?

2017-03-13 05:50:09 -0500 commented answer rqt freezes

Hi, I tried it, RVIZ standalone and it still freezes! :(

Can anyone give me a heads up of what to check? Network? laptop configuration?

2017-03-08 23:21:03 -0500 commented answer rqt freezes

Thank you for your response! :) Will try to do it!

I wanted to create a GUI with everything on one screen. I was just thinking what could be the reason, and how to improve it.

Any idea of how to handle high amount of data so that it will flow with low latency?

2017-03-08 03:56:25 -0500 asked a question rqt freezes

I am creating a GUI for a robot using rqt_gui, both connected together by the same WIFI network.

The plugins in my rqt_gui are 1) RVIZ, 2) Image_view and 3)dynamic_reconfigure.

Whenever i run the rqt_gui, and access RVIZ , the whole rqt_gui freezes and turns black shortly. Thus i am unable to do anything with it.

RVIZ - For LIDAR map and navigation through it

Image_view - To have live camera feed from the robot

rqt_dynamic_reconfigure - to change the parameters of the robot from the laptop

Can someone please tell me why am i facing the problem and is there any solution to the problem!

My laptop is Lenovo ideapad 700 running in Ubuntu 14.04 and ROS Indigo.

Please let me know if there is need for any other info.

Any form of help would be apprciated!

2017-03-01 22:36:07 -0500 received badge  Notable Question (source)
2017-02-13 02:37:28 -0500 answered a question Dynamic reconfigure

THANKS @gvdhoom!

i managed to get what i want using the dynamic_reconfigure!

General info: The config is a dictionary which stores the True/False value of the parameter. So by playing with it , you can control what you want to do!

#!/usr/bin/env python
PACKAGE = 'dynamic_tutorials'
import roslib;roslib.load_manifest(PACKAGE)
import rospy
import dynamic_reconfigure.client

from geometry_msgs.msg import Vector3, Twist

def callback(config):
    global pub,tw,cw,global_name, client
    print config
    global_name = config['bool_param']

pub = rospy.Publisher('/turtle1/cmd_vel', Twist)    
tw = Twist(Vector3(1,2,0), Vector3(0,0,1))
cw = Twist(Vector3(1,2,0),Vector3(0,0,-1))

if __name__ == "__main__":
    rospy.init_node("dynamic_client")
    rospy.wait_for_service("/dynamic_tutorials/set_parameters")

    client = dynamic_reconfigure.client.Client("dynamic_tutorials", timeout=30, config_callback=callback)

   r = rospy.Rate(1)
   global_name = rospy.get_param("/dynamic_tutorials/bool_param")
   while not rospy.is_shutdown():              
   if global_name:
        pub.publish(tw)
    else:
        pub.publish(cw)

    r.sleep()
2017-02-13 02:27:11 -0500 received badge  Popular Question (source)
2017-02-09 10:24:50 -0500 received badge  Famous Question (source)
2017-02-06 06:07:11 -0500 received badge  Notable Question (source)
2017-02-06 05:24:35 -0500 commented question Dynamic reconfigure

i need dynamic_reconfigure to able to change between modes for an autonomous vehicle, which is the ultimate goal. I am using turtlesim to find out how it can be done first.

Is it possible for you to guide me what i should have in my callback, to get the intended function? Any form of guide! :)

2017-02-06 04:25:25 -0500 commented question Dynamic reconfigure

Basically I want an on/off button in my dynamic_reconfigure, to publish my customized data. So if the button is "on", it would publish the data.

Current problem : 1) the button in the dynamic configure does not have any effect on the turtle when turned "on" or "off".

2017-02-05 21:45:46 -0500 edited question Dynamic reconfigure

this is my client.py

#!/usr/bin/env python

PACKAGE = 'dynamic_tutorials'
import roslib;roslib.load_manifest(PACKAGE)
import rospy
import dynamic_reconfigure.client

from geometry_msgs.msg import Vector3, Twist

def callback(config):
    rospy.loginfo("Config set to {bool_param}".format(**config))

if __name__ == "__main__":
    rospy.init_node("dynamic_client")
    pub = rospy.Publisher('/turtle1/cmd_vel', Twist)
    rospy.wait_for_service("/dynamic_tutorials/set_parameters")
    tw = Twist(Vector3(1,2,0), Vector3(0,0,1))
    client = dynamic_reconfigure.client.Client("dynamic_tutorials", timeout=30, config_callback=callback)

    r = rospy.Rate(1)
    x = 0
    b = True

    while not rospy.is_shutdown():

        x = x+1
        if x >5:  
            pub.publish(tw) 
            x=0   

        client.update_configuration({"bool_param":b})
        r.sleep()

When i run my server.py and client.py and turtlesim_node and dynamic_reconfigure, the turtle in the turtlesim node goes in circle every 5 seconds(regardless if the bool_param in dynamic reconfigure is ticked or unticked). If i click the bool_param, it becomes unticked immediately.

Intended action: When i click on a button(bool_param, in this case is ticked) in rqt_dynamic_reconfigure , it should publish the command and remain publishing the command untill i give further instructions.

How can i implement this action? I need to control the turtle movement using dynamic_reconfigure.

Thank you!