problems seeing dynamic_reconfigure (python)
I tried to follow the tutorial but i am stll lost.
after completeing the relevant files, "rosrun rqtgui rqtgui -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()
Asked by Azhar on 2017-01-15 12:50:04 UTC
Answers
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 :)
Asked by Azhar on 2017-01-16 05:49:12 UTC
Comments