Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all 126 articles
Browse latest View live

Annoying dynamic_reconfigure code regeneration on catkin_make

$
0
0
The dynamic reconfigure code generation looks it is being executed unconditionally even if the python generation script (.cfg) did not change. This means that everytime that catkin_make command is called some new header (.h) files are generated by the dynamic_reconfigure cmake functionality. Because of this, the "incremental build mechanism" of cmake gets broken and your *.cpp files that depens on those headers recompile. This may make the development process slower. Is this the expected behavior of the dynamic_reconfigure code generation system? Is there any way to avoid breaking the incremental build of cmake? Until the current moment I have worked with these approaches (but I would like to avoid them because they do not satisfy me totally): - the dynamic reconfigure files to other project and use the catkin_make's "black package list" - building manually the targets I need the catkin_make's "--pkg" flag

error generating dynamic reconfigure .h files

$
0
0
Hello I am migrating a package from rosmake to catkin. So far I've been sucessfull. The only problem is that, I don't know why, when it generates de dynamic reconfigure configuration files (the ones ending in Config.h in the case of c++) are not stored in devel/include/PACKAGE_NAME/. What it actually happends is that it apperars folder within the src of the package with the name of the package containing the python for the dynamic reconfigure and another one in the folder wher I have the configuration file for generating the dynamic reconfigure options called cpp where the .h file is stored. I've been able to reproduce the same problem with [this](https://www.dropbox.com/s/subw9x54454iuk2/test.tar.gz?dl=0) test package. Could you help me? Thanks!!

Dynamic Reconfigure - Can I Set An Array Of Values?

$
0
0
Hi, I want to use `dynamic_reconfigure` in one of my nodes, however, one of my parameters is actually a variably-sized array of doubles. Can `dynamic_reconfigure` support variably-sized arrays, or does it only handle name-value pairs and structures? Would a service with custom message type be a better solution for setting the array? Thank you for your help.

Regards to dynamic_reconfigure and "How to Write Your First .cfg File" tutorial.

$
0
0
TOPIC: dynamic_reconfigure LINK: http://wiki.ros.org/dynamic_reconfigure/Tutorials/HowToWriteYourFirstCfgFile Personal working environment: Ubuntu 14.04, Indigo running on Raspi 2 QUESTION: In the tutorial, the writer indicates that the min and max are optional per below. min - specifies the min value (optional and does not apply to strings and bools) max - specifies the max value (optional and does not apply to strings and bools) ISSUE: The issue I encountered when NOT specifying the min and max was the default values not initializing correctly. For example when I was expecting a double_t initial parameter of 0.0, I was getting -std::numeric_limits::infinity() instead. Specifying a min and max resolved the issue. Is this expected? Thank you.

dynamic_reconfigure function not found during link

$
0
0
Hi, I am trying to use AMCL for localization. when instantiating AMCLConfig it refers to dynamic_reconfigure package. so I added following statements in the CMakelists.txt cmake_minimum_required(VERSION 2.8.3) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) project(agv) set(EXECUTABLE_OUTPUT_PATH bin) find_package(catkin REQUIRED COMPONENTS message_filters laser_geometry roscpp rospy geometry_msgs std_msgs nav_msgs sensor_msgs tf2_msgs actionlib_msgs amcl tf genmsg dynamic_reconfigure message_generation ) set(Boost_USE_MULTITHREADED ON) find_package(Boost COMPONENTS thread date_time program_options filesystem system REQUIRED) rosbuild_add_boost_directories() find_package(catkin REQUIRED tf) # dynamic reconfigure generate_dynamic_reconfigure_options( src/navigation_node/cfg/AMCL.cfg ) ########### include(FindProtobuf) find_package(Protobuf REQUIRED) include_directories(${PROTOBUF_INCLUDE_DIR}) find_package(Eigen REQUIRED) include_directories(${EIGEN_INCLUDE_DIRS}) add_definitions(${EIGEN_DEFINITIONS}) ############ ## System dependencies are found with CMake's conventions find_package(Boost REQUIRED COMPONENTS system thread log log_setup program_options) find_package( Threads ) add_message_files( FILES agv.msg laser.msg lasergeo.msg nav_odo.msg tf_msg.msg # Message1.msg # Message2.msg ) generate_messages( DEPENDENCIES geometry_msgs sensor_msgs nav_msgs std_msgs tf2_msgs ) catkin_package( # INCLUDE_DIRS include ../include .. # LIBRARIES beginner_tutorials CATKIN_DEPENDS roscpp rospy std_msgs geometry_msgs sensor_msgs tf2_msgs nav_msgs message_runtime message_filters tf #dynamic_reconfigure DEPENDS system_lib LIBRARIES laser_geometry DEPENDS boost Eigen #INCLUDE_DIRS include LIBRARIES amcl_sensors amcl_map amcl_pf ) include_directories(include ${catkin_INCLUDE_DIRS} ../include ../third_party_lib/include) set(LASER_PATH src/laser_node) add_executable(Node_laser ${LASER_PATH}/LMS1xx_node.cpp ${LASER_PATH}/LMS1xx.cpp) add_dependencies(Node_laser laser_generate_cpp) target_link_libraries(Node_laser pthread boost_filesystem boost_system log4cpp) target_link_libraries(Node_laser ${catkin_LIBRARIES}) #target_link_libraries (Node_laser /opt/ros/hydro/lib/lms1xx/LMS1xx_node ) target_link_libraries(Node_laser ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${PROTOBUF_LIBRARY} ) add_definitions("-std=c++0x -pthread -llog4cpp") set(LOCALIZATION_PATH src/localization_node) add_library(laser_geometry ${LOCALIZATION_PATH}/laser_geometry.cpp) target_link_libraries(laser_geometry ${Boost_LIBRARIES} ${tf_LIBRARIES}) add_executable(Node_localization ${LOCALIZATION_PATH}/main.cpp) add_dependencies(Node_localization localization_generate_cpp) target_link_libraries(Node_localization boost_filesystem boost_system boost_thread log4cpp) target_link_libraries(Node_localization ${catkin_LIBRARIES}) target_link_libraries(Node_localization laser_geometry) target_link_libraries(Node_localization ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${PROTOBUF_LIBRARY} ) add_definitions("-std=c++0x -pthread -llog4cpp -eigen3") add_library(amcl_pf src/navigation_node/amcl/pf/pf.c src/navigation_node/amcl/pf/pf_kdtree.c src/navigation_node/amcl/pf/pf_pdf.c src/navigation_node/amcl/pf/pf_vector.c src/navigation_node/amcl/pf/eig3.c src/navigation_node/amcl/pf/pf_draw.c) add_library(amcl_map src/navigation_node/amcl/map/map.c src/navigation_node/amcl/map/map_cspace.cpp src/navigation_node/amcl/map/map_range.c src/navigation_node/amcl/map/map_store.c src/navigation_node/amcl/map/map_draw.c) add_library(amcl_sensors src/navigation_node/amcl/sensors/amcl_sensor.cpp src/navigation_node/amcl/sensors/amcl_odom.cpp src/navigation_node/amcl/sensors/amcl_laser.cpp) target_link_libraries(amcl_sensors amcl_map amcl_pf) set(NAVI_PATH src/navigation_node) #include_directories(${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) add_executable(Node_navi ${NAVI_PATH}/amcl_node.cpp) add_dependencies(Node_navi navi_generate_cpp) target_link_libraries(Node_navi amcl_sensors amcl_map amcl_pf pthread boost_filesystem boost_system ) target_link_libraries(Node_navi ${catkin_LIBRARIES}) target_link_libraries(Node_navi ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${PROTOBUF_LIBRARY} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) add_definitions("-std=c++0x -pthread") and package dependency in package.xml But, during LINK, the linker always complains not able to find packaged function `dynamic_reconfigure::__init_mutex__' amcl_node.cpp:(.text._ZN4amcl10AMCLConfig15__get_statics__Ev[amcl::AMCLConfig::__get_statics__()]+0x23): undefined reference to `dynamic_reconfigure::__init_mutex__' am I missing anything here?

How to call dynamic_reconfugure service of base_local_planner through code

$
0
0
Hello everyone! I want to modify the max_vel_x in base_local_planner_params.yaml at runtime. I followed the tutorial [Dynamic Reconfigure Python Client](http://wiki.ros.org/dynamic_reconfigure/Tutorials/UsingTheDynamicReconfigurePythonClient ) to create a client : #!/usr/bin/env python PACKAGE = 'base_local_planner' import roslib;roslib.load_manifest(PACKAGE) import rospy import dynamic_reconfigure.client if __name__ == "__main__": rospy.init_node("blp_client") client = dynamic_reconfigure.client.Client("base_local_planner", timeout=4, config_callback=None) r = rospy.Rate(0.33) while not rospy.is_shutdown(): client.update_configuration({"max_vel_x":0.06}) r.sleep() Then I ran `roslaunch my_new_robot robot_config.launch`; `roslaunch my_new_robot move_base.launch`; `rosrun base_local_planner blp_client.py`(since I was using navigation). But errors were reported: youjian@youjian-laptop:~$ rosrun base_local_planner blp_client.py Traceback (most recent call last): File "/home/youjian/catkin_ws/src/base_local_planner/scripts/blp_client.py", line 16, in client = dynamic_reconfigure.client.Client("base_local_planner", timeout=4, config_callback=callback) File "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/client.py", line 84, in __init__ self._set_service = self._get_service_proxy('set_parameters', timeout) File "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/client.py", line 305, in _get_service_proxy rospy.wait_for_service(service_name, timeout) File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 143, in wait_for_service raise ROSException("timeout exceeded while waiting for service %s"%resolved_name) rospy.exceptions.ROSException: timeout exceeded while waiting for service /base_local_planner/set_parameters I dig into `dynamic_reconfigure/src/dynamic_reconfigure/client.py`: line 65: @param name: name of the server to connect to (usually the node name) So according to the error, it can't find a node called base_local_planner. Hence, I wonder if base_local_planner is a node,since I don't find `ros::init(argc, argv, "base_local_planner")` which indicates a node in any files in base_local_planner package. If base_local_planner is not a node, what should I give to the 1st paramenter of the function Client(), or is there another way to modify the max_vel_x at runtime through code not command and rqt_reconfigure gui. The following is some codes relative to dynamic_reconfigure in base_local_planner/src/trajectory_planner_ros.cpp: dsrv_ = new dynamic_reconfigure::Server(private_nh); dynamic_reconfigure::Server::CallbackType cb = boost::bind(&TrajectoryPlannerROS::reconfigureCB, this, _1, _2); dsrv_->setCallback(cb); thanks in advance!

dynamic reconfigure callback happens automatically when a node is launched without rqt client

$
0
0
I am using dynamic_reconfigure in my node to adjust some params dynamically. I found that the first callback for dynamic reconfigure happens when the node is launched, specifically when I define the callback for dynamic reconfigure in my constructor. This causes my node to reject param values defined in my launch file and take in default values defined in cfg file for dynamic reconfigure. I would expect the callback to happen only when I launch rqt_dynamic_reconfigure which sets up a client, not when I set up the server in my node. At least a regular ROS server and client works this way, not callback on server side until a client makes calls to that server. In the implementation of dynamic reconfigure, is there a way to not have the callback happen when server is set up and only change param values when I launch rqt_dynamic_reconfigure?

Can't get dynamic reconfigure to spin when callback is a member of a class

$
0
0
I am using ROS Indigo, Ubuntu 14.04. Get no compile errors. When I debug with GDB I can see I go into my callback once, but no more thereafter. This also happened when the callback was made global outside the class. I thought that perhaps this was why it was not being called. But it seems this is not the problem. I have three other subscription callbacks in this code that work fine as well one publication. Below I show the callback and the main function. Currently I use spinOnce() but I have tried other spin mechanisms like spin() AsyncSpinner, MultiThreadedSpinner to see if that made a difference. The full file / ROS package can be found here: https://github.com/birlrobotics/birl_baxter_controllers/blob/master/force_controller/src/force_controller_topic.cpp Any help would be greatly appreciated. namespace force_controller { //*********************************************************************************************************************************************** // callback(...) for dynamic Reconfigure set as a global function. // When the rqt_reconfigure gui is used and those parameters are changed, the config.param_name in this function will be updated. Then, these parameters need to be set to the private members of your code to record those changes. //*********************************************************************************************************************************************** //void callback(force_error_constants::force_error_constantsConfig &config, uint32_t level) void controller::callback(force_error_constants::force_error_constantsConfig &config, uint32_t level) { // Print the updated values ROS_INFO("Dynamic Reconfigure Prop gains: %f %f %f %f %f %f\nDerivative gains: %f", // Proportional Gains config.k_fp0, config.k_fp1, config.k_fp2, config.k_mp0, config.k_mp1, config.k_mp2, // Derivative Gains config.k_fv0); // Save proportional gains to the corresponding data members. k_fp0=config.k_fp0; k_fp1=config.k_fp1; k_fp2=config.k_fp2; k_mp0=config.k_mp0; k_mp1=config.k_mp1; k_mp2=config.k_mp2; // Save derivative gains to the corresponding data members. k_fv0=config.k_fv0; // change the flag force_error_constantsFlag = true; } ... ---------------- int main(int argc, char** argv) { ros::init(argc, argv, "control_basis_controller"); // Create a node namespace. Ie for service/publication: /topic_name or for parameters: /param_name ros::NodeHandle node("~"); // Instantiate the controller force_controller::controller myControl(node); // Set up the Dynamic Reconfigure Server to update controller gains: force, moment both proportional and derivative. if(myControl.dynamic_reconfigure_flag) { // (i) Set up the dynamic reconfigure server dynamic_reconfigure::Server srv; // (ii) Create a callback object of type force_error_constantsConfig dynamic_reconfigure::Server::CallbackType f; // (iii) Bind that object to the actual callback function //f=boost::bind(&force_controller::callback, _1, _2); // Used to pass two params to a callback. // Bind a new function f2 with the force_controller::controller::callback. // The left side of the command, tells boost that the callback returns void and has two input parameters. // It also needs the address of the this pointer of our class, and the indication that it has the two parameters follow the order _1, _2. boost::function f2( boost::bind( &force_controller::controller::callback,&myControl, _1, _2 ) ); // (iv) Set the callback to the service server. f=f2; // Copy the functor data f2 to our dynamic_reconfigure::Server callback type srv.setCallback(f); // Update the rosCommunicationCtr myControl.rosCommunicationCtrUp(); } if(!myControl.start()) { ROS_ERROR("Could not start controller, exiting"); ros::shutdown(); return 1; } ros::Rate rate( myControl.get_fcLoopRate() ); /*** Different Communication Modes ***/ while(ros::ok()) { // 1. Non Blocking spin ros::spinOnce(); myControl.force_controller(); rate.sleep(); } return 0; }

How to set PointGrey framerate?

$
0
0
I have a Point Grey Flea3 camera using pointgrey_camera_driver. Every time I launch it in ROS the frame rate is 7 FPS. I am able to change the frame rate to 30 FPS using rqt_reconfigure. I would like for the camera to start at 30 FPS by default. I have tried adding it as a param to the launch file but that didn't work. I also tried adding it to PointGrey.cfg but that didn't work either. I also tried adding it in the command line using "frame_rate:=30" but that didn't work. ## Camera.launch ## ## PointGrey.cfg ## gen.add("frame_rate", double_t, SensorLevels.RECONFIGURE_RUNNING, "Camera speed (frames per second).", 30, 0, 100)

dynamic_reconfigure tutorial problems

$
0
0
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_reconfigure/Tutorials. 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.const("Large", int_t, 2, "A large constant"), gen.const("ExtraLarge", int_t, 3, "An extra large constant")], "An enum to set size") gen.add("size", int_t, 0, "A size parameter which is edited via an enum", 1, 0, 3, edit_method=size_enum) exit(gen.generate(PACKAGE, "dynamic_tutorials", "Tutorials")) 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() package.xml dynamic_tutorials0.0.0The dynamic_tutorials packageazharTODOcatkindynamic_reconfigureroscpprospydynamic_reconfigureroscpprospy Any help would be greatly appreciated. I am using ubuntu 14.04 LTS and ROS indigo . :)

problems seeing dynamic_reconfigure (python)

$
0
0
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 dynamic_tutorials0.0.0The dynamic_tutorials packageazhartodocatkindynamic_reconfigurerospystd_msgsdynamic_reconfigurestd_msgsrospy 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()

Dynamic reconfigure of gmapping parameters

$
0
0
Hello all, I'd like to change the gmapping parameters namely xmin, ymin, xmax, ymax dynamically. My first thought was to use the dynamic_reconfigure package, but it seemed that it requires changing the source code of the gmapping. My second thought was to use system calls from a different node to execute: `system("rosnode kill slam_gmapping");` `system("rosrun gmapping slam_gmapping xmin:=foo ymin:=bra xmax:=foo ymax:=bra &")` However, it seemed that the new gmapping process blocks the node from which the system calls were executed. Please note that I appended the ampersand in the end of the line, but it didn't help. Anyways, using system calls doesn't sound to be a very good way. What would be the common way to do this? Thank you in advance.

dynamic reconfigure

$
0
0
i get this error when i run a node. azhar@Azhar:~/catkin_ws$ rosrun dynamic_tutorials server.py Traceback (most recent call last): File "/home/azhar/catkin_ws/src/dynamic_tutorials/nodes/server.py", line 5, in from dynamic_reconfigure.server import Server File "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/server.py", line 49, in from dynamic_reconfigure import DynamicReconfigureCallbackException ImportError: cannot import name DynamicReconfigureCallbackException background. The node server.py was working initially. However, i moved the package to another location temporarily, as i wanted to test out another package from github, with the same name. I git-clone the new package, catkin_make and tried to run . Once i finished using it, i deleted it and moved my initial package back. I get this error again when i try to run the node. So , i believe the package i downloaded messed up some of the files.(because it has the same name) Can anyone suggest any ways on how to fix this? Thank you! My package: https://github.com/azhar92/dynamic_reconfigure-turtlesim

Dynamic reconfigure

$
0
0
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!

how to add dynamic_reconfigure to arduino

$
0
0
I'm trying to follow the [guide](http://wiki.ros.org/dynamic_reconfigure/Tutorials/HowToWriteYourFirstCfgFile) to set up my cfg file, but I'm not sure how to configure my CMakeLists file correctly. The guide says to add the following line of code: add_dependencies(example_node ${PROJECT_NAME}_gencfg) but I'm not sure what my `example_node` would be in the case of using it on an arduino. I tried `rosserial` and `rosserial_arduino`, but those didn't work.

dynamic_reconfigure callback function not called

$
0
0
I am using a simple dynamic_reconfigure server with a callback. The callback runs once when I launch the node but does not run after that when I change parameters using rqt. I have run the command `rosrun dynamic_reconfigure dynparam list` but I do not see any of the parameters that I use. I am using to following code to start the server and callback: dynamic_reconfigure::Server server; dynamic_reconfigure::Server::CallbackType f; f = boost::bind(&extrinsicsCallback, _1, _2); server.setCallback(f); Another issue is also that if I move the above code to the end of my main function, it does not seem to run even on the launch time. The following is my main function: int main(int argc, char* argv[]) { //Ros initializations. ros::init(argc, argv, nodeName.str()); //ros::NodeHandle n[numPorts]; std::shared_ptr nhPtr; nhPtr = std::make_shared(); std::shared_ptr cameraInfoManager; cameraInfoManager = std::make_shared(*nhPtr.get(), cameraName.str()); ///================== Works here (only once at launch time) ======================== dynamic_reconfigure::Server server; dynamic_reconfigure::Server::CallbackType f; f = boost::bind(&extrinsicsCallback, _1, _2); server.setCallback(f); ///======================================================================== std::string calibPath; nhPtr->getParam(ros::this_node::getName()+"/calib_path", calibPath); if(!cameraInfoManager->loadCameraInfo(calibPath)) { ROS_INFO("Camera info could not be loaded."); } std::shared_ptr it = std::make_shared(*nhPtr.get()); std::shared_ptr stereoPub = std::make_shared //(it->advertiseCamera(ros::this_node::getNamespace()+"/image_raw", 10)); (it->advertiseCamera("image_raw", 5)); std::shared_ptr timestampPublisher = std::make_shared(nhPtr.get()->advertise("timestamp", 1)); signal(SIGINT, stopSignalHandler); ImageBuilder<720, 487, 10> imageBuilder(stereoPub, cameraInfoManager, timestampPublisher); imageBuilder.buildImages(); ///================== Does not get invoked at all =============================== //dynamic_reconfigure::Server server; //dynamic_reconfigure::Server::CallbackType f; //f = boost::bind(&extrinsicsCallback, _1, _2); //server.setCallback(f); ///=================================================================== ros::spin(); } Hoping to get some help on this problem. Thanks

dyn_recfg c++: compiling but no items in rqt_reconfigure

$
0
0
HI, I try to get the dynamic reconfigure to run in c++. My Project is compiling without problems, but the variables do not appear in rqt? I have a class based structure like following: //Class Instance: class_instance.h #include "ros/ros.h" #include "project_name/ManipulatorConfig.h" #include #include class ClassInstance{ void ClassInstance::subReconfigureCallback(project_name::ProjectConfig &config, uint32_t level) { ROS_INFO("Reconfigure Request: %f", config.joint1_angle); ROS_INFO("Reconfigure Request: %f", config.joint2_angle); ROS_INFO("Reconfigure Request: %f", config.joint3_angle); } ClassInstance(){ dynamic_reconfigure::Server server; dynamic_reconfigure::Server::CallbackType f; f = boost::bind(&ClassInstance::subReconfigureCallback, this, _1, _2); server.setCallback(f); } } //Main: main.cpp #include "ros/ros.h" #include "class_instance.h" int main(int argc, char **argv){ ros::init(argc, argv, "project_name_node"); ClassInstance class_instance; ros::spin(); return 0; } //ProjectConfig.cfg #!/usr/bin/env python PACKAGE = "project_name" from dynamic_reconfigure.parameter_generator_catkin import * gen = ParameterGenerator() gen.add("var1", double_t, 0, "A double parameter", 0, 0.0, 2.0) gen.add("var2", double_t, 0, "A double parameter", 0, 0.0, 2.0) gen.add("var3", double_t, 0, "A double parameter", 0, 0.0, 2.0) exit(gen.generate(PACKAGE, "project_name", "Project")) The CMAKELISTS and PACKAGE are created according to the dynamix reconfigure tutorial. Do you have any idea? Thanks a lot!

Dynamic reconfigure tutorial

$
0
0
I have studied dynamic reconfigure to use it with my project. I had followed the tutorial until http://wiki.ros.org/dynamic_reconfigure/Tutorials/UsingTheDynamicReconfigurePythonClient. However, after I ran both server.py and client.py, they did not show the same results. The sever.py showed print out but client.py did not. So, someone please help me to find out.

The result of Dynamic_reconfigure tutorial not update

$
0
0
I have studied dynamic reconfigure to use it with my project. I had followed the tutorial until http://wiki.ros.org/dynamic_reconfigure/Tutorials/UsingTheDynamicReconfigurePythonClient. However, after I ran both server.py and client.py, they did not show the same results which is different to what tutorial say. The terminal that I run client.py did not print anything and for server.py terminal print once and not update anything. And after I ctr+C to exist the client.py it give me these msgs which I really confuse about it. Traceback (most recent call last): File "/home/beerlablinux/catkin_ws/src/dynamic_tutorials/nodes/client.py", line 15, in rospy.wait_for_service("dynamic_tutorials") File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 159, in wait_for_service raise ROSInterruptException("rospy shutdown") rospy.exceptions.ROSInterruptException: rospy shutdown I try to find out the solution in Q&A and follow this http://answers.ros.org/question/217402/request-update-in-dynamic-reconfigure-tutorial/ but it still be the same. Sorry for my English and please help me. I use ROS kinetic and Ubuntu 16.04 LTS.

Possible to shut off obstacle avoidance (husky)?

$
0
0
Hello ROS-community, I have a problem you might help me figure out. I am using a husky to pick up certain objects, let's say these objects are boxes. I have a breadcrumb following navigation node that communicates with move_base to maneuver the environment and approach the box. The problem is that if i want to approach the box the husky will treat the box as an obstacle, thus trying to avoid it. Is it possible to "shut off" the obstacle avoidance, pickup the box, and power it on? I was reading this thread: http://answers.ros.org/question/12276/is-there-a-c-api-for-a-dynamic-reconfigure-client/ And thinking there might be a parameter i could reconfigure during runtime. Another problem i have is that i want to be able to take the fastest path if in order to align the husky to the box properly. If i give a goal point to move_base that's behind the husky, i want it to go backwards. But at the same time if the goal point is in front of the husky, it should move forward. Is this a possible behavior using dynamic reconfigure? Another think with dynamic reconfigure as the thread above: Is there a need to call some sort of update, in order for the new parameters to take place? I made a simple node like the thread above to reconfigure some move_base parameters but when i read them from the terminal they hadn't changed. TLDR: 1) Is it possible to "shut off" and "power on" obstacle avoidance during runtime? 2) Is it possible to have a behaviour that takes fastest path possible, which goes backwards if needed, and switch to "normal" maneuvering behaviour during runtime? 3) Do I need to call some sort of update for my dynamically reconfigured parameters to take place? Thanks in advance! Wbr Mattias
Viewing all 126 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>