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

problems seeing dynamic_reconfigure (python)

asked 2017-01-15 11:50:04 -0500

Azhar gravatar image

updated 2017-01-16 04:41:46 -0500

I tried to follow the tutorial but i am stll lost.

after completeing the relevant files, "rosrun rqt_gui rqt_gui -s reconfigure " was keyed a pop up with empty folders and buttons that do not reaact to any range.

May i know why is there a problem? am i missing something?

CMakeLists.txt

   cmake_minimum_required(VERSION 2.8.3)
   project(dynamic_tutorials)

   find_package(catkin REQUIRED COMPONENTS
      dynamic_reconfigure
      rospy
      std_msgs
      message_generation
      )

    generate_dynamic_reconfigure_options(
     cfg/Tutorials.cfg
      )

     catkin_package(CATKIN_DEPENDS dynamic_reconfigure rospy)

      add_dependencies(Tutorials ${PROJECT_NAME}_gencfg)

package.xml

    <?xml version="1.0"?>
    <package>
     <name>dynamic_tutorials</name>
     <version>0.0.0</version>
     <description>The dynamic_tutorials package</description>

     <maintainer email="azhar@todo.todo">azhar</maintainer>

      <license>todo</license>

      <buildtool_depend>catkin</buildtool_depend>
      <build_depend>dynamic_reconfigure</build_depend>
      <build_depend>rospy</build_depend>
      <build_depend>std_msgs</build_depend>
       <run_depend>dynamic_reconfigure</run_depend>
       <run_depend>std_msgs</run_depend>
       <run_depend>rospy</run_depend>

        <export>
         </export>
         </package>

server.py

        #!/usr/bin/env python

         import rospy

        from dynamic_reconfigure.server import Server
        from dynamic_tutorials.cfg import TutorialsConfig

        def callback(config, level):
         rospy.loginfo("""Reconfigure Request: {int_param}, {double_param},\ 
      {str_param}, {bool_param}, {size}""".format(**config))
      return config

      if __name__ == "__main__":
       rospy.init_node("dynamic_tutorials", anonymous = True)

       srv = Server(TutorialsConfig, callback)
       rospy.spin()
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-01-16 04:49:12 -0500

Azhar gravatar image

ok i solved by changing the name of the node and made it consistent in all the files.

In addition i added the following in CMakeLists.txt,

 set_target_properties(dynamic_tutorials_node PROPERTIES LINKER_LANGUAGE CMAKE_py_LINK_EXECUTABLE)

and it works :)

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-01-15 11:50:04 -0500

Seen: 487 times

Last updated: Jan 16 '17