ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
2021-10-21 07:51:10 -0500 | received badge | ● Favorite Question (source) |
2019-10-24 14:01:32 -0500 | received badge | ● Nice Question (source) |
2018-10-09 11:13:22 -0500 | received badge | ● Nice Question (source) |
2017-03-15 13:35:19 -0500 | received badge | ● Nice Question (source) |
2014-04-20 12:27:22 -0500 | marked best answer | how to get the starting simulation time from gazebo ? Dear, I have a controller for a simple robot in gazebo. In my controller, I need to get the starting simulated time because there is lag between starting gazebo simulation and starting my controller. In my controller, I used this line (Init_time) to get the starting simulation time, but it always got out 0. Init_time = ros::Time::now().toSec(); double time = odom->header.stamp.toSec(); |
2014-04-20 12:26:44 -0500 | marked best answer | how to add a subscriber in keyboard teleop ? Hi, I have an incomplete C++ code which intends to add a subscriber to get state from robot model. Due to my limited knowledge, I can not proceed on the below code. What I want from this code is to get robot states ("base_pose_ground_truth":position and velocity) and put a simple proportional trajectory following controller for a desired trajectory (double desired_pos = 15 * sin(ros::Time::now().toSec());). During compiling it, I have the error messages: .../src/keyboard.cpp:113:17: error: cannot convert ‘ros::Subscriber’ to ‘double’ in assignment .../src/keyboard.cpp:117:45: error: ‘max_force’ cannot be used as a function .../src/keyboard.cpp:118:45: error: ‘max_force’ cannot be used as a function ----The below is the incomplete C++ code ------------------- |
2014-04-20 12:26:44 -0500 | marked best answer | how to get states (position and velocity) from the simple box robot ? Hi, I have simple box robot model which is controlled by keyboard teleop in the gazebo environment. The next step I want to do is putting a simple feedback controller. The first thing I need to do is to get robot model states (position and velocity of center of gravity of the simple box robot model). And the next step I think is that the keyboard teleop should subscribe the states. Are these procedures are right? If then, could you let me know how to get the robot model states ? Should I have put robot state publisher into robot urdf ? If there is appropriate link or tutorial, please let me know. And if there is other way for me to do a feedback control for the simple box robot, please let me know. |
2014-04-20 12:26:44 -0500 | marked best answer | how to put subscriber and publisher in one cpp file ? Hi, I have a limited knowledge in C++ so that feel a difficulty in combining a subscriber and a publisher in one C++ file. Based on the tutorial, http://www.ros.org/wiki/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29 , could anybody give some directions on making one C++ file which includes a subscriber and a publisher ? |
2014-04-20 12:26:31 -0500 | marked best answer | How to modify or change C++ file located in the ROS stack I have the following error message: /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp:52: error: ‘class pr2_mechanism_model::JointState’ has no member named ‘position_1’ /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp:53: error: ‘class pr2_mechanism_model::JointState’ has no member named ‘position_2’ I think it mean I have to delare "position_1" and "position_2" in the "joint.h" file, but this header file belongs to ROS stack so that it will not be changed. Is anybody who know how to modify the C++ header file belonged to ROS stack? |
2014-04-20 12:26:16 -0500 | marked best answer | Simple URDF-Controller Example Hi, I have been trying to figure it out "Simple URDF-Controller Example" in the following link, http://www.ros.org/wiki/pr2_mechanism/Tutorials/SImple%20URDF-Controller%20Example. If there is anyone who know the details to follow the above example, could you let me know it? I followed all the required recommendation, but could not complete the tutorial. Before describing what problems I have in following the "Simple URDF-Controller Example", I want to say that my overall goal is that making robot model, putting state feedback controller, and simulating using ROS. Eventually the final goal will be implementing on Gumstix. About following the above tutorial, "Simple URDF-Controller Example", I followed the recommended tutorial, "Writing a realtime joint controller", which is on the link, http://www.ros.org/wiki/pr2_mechanism/Tutorials/Writing%20a%20realtime%20joint%20controller . I have no problem in this tutorial. Based on this tutorial, to follow the tutorials of "Simple URDF-Controller Example", the procedures I have taken are: $ roscreate-pkg my_controller_pkg pr2_controller_interface pr2_mechanism_model pluginlib $ roscd my_controller_pkg $ rosmake And I put robot.xml (which is in the also create a directory src and a file called src/my_controller_file.cpp ) inside the new package and create the directory include, then include/my_controller_pkg/my_controller_file.h, where this .h file is in "Writing a realtime joint controller". And also create a directory src and a file called src/my_controller_file.cpp, where this .cpp file is made according to "Simple URDF-Controller Example" and "Writing a realtime joint controller". And Open the CMakeLists.txt file, and add the following line on the bottom: rosbuild_add_library(my_controller_lib src/my_controller_file.cpp) and $ make Then the following error messages are shown: /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp: In member function ‘virtual bool my_controller_ns::MyControllerClass::init(pr2_mechanism_model::RobotState*, ros::NodeHandle&)’: /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp:22: error: ‘wheel1_state’ was not declared in this scope /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp:38: error: ‘wheel2_state’ was not declared in this scope /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp:50: error: a function-definition is not allowed here before ‘{’ token /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp:57: error: a function-definition is not allowed here before ‘{’ token /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp:66: error: a function-definition is not allowed here before ‘{’ token /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp: At global scope: /home/username/ros_workspace/my_controller_pkg/src/my_controller_file.cpp:67: error: expected ‘}’ at end of input make[3]: * [CMakeFiles/my_controller_lib.dir/src/my_controller_file.o] Error 1 make[3]: Leaving directory `/home/username/ros_workspace/my_controller_pkg/build' make[2]: * [CMakeFiles/my_controller_lib.dir/all] Error 2 make[2]: Leaving directory `/home/username/ros_workspace/my_controller_pkg/build' make[1]: * [all] Error 2 make[1]: Leaving directory `/home/username/ros_workspace/my_controller_pkg/build' make: * [all] Error 2 That is why I can not proceed on the tutorial, "Simple URDF-Controller Example". Here is my_controller_file.cpp: include "my_controller_pkg/my_controller_file.h" include <pluginlib class_list_macros.h=""> namespace my_controller_ns { /// Controller initialization in non-realtime bool MyControllerClass::init(pr2_mechanism_model::RobotState *robot, ros::NodeHandle &n) { std::string wheel1, wheel2; ///Link all Joints //////////////////////////////////////////////////////////////////////// if (!n ... (more) |
2014-04-20 06:50:52 -0500 | marked best answer | tf tutorial warning message Hi, I am trying to follow this tutorial, but I got the following messages: Could anyone resolve this problem? My system info: Ubuntu 11.04, ROS electric |
2014-04-20 06:50:10 -0500 | marked best answer | Difference between <dynamics damping="0.7" friction="100.0" /> and <mu1>1</mu1> Hi, Could anyone give me some explanation the difference between dynamics damping, and mu1, mu2 in the urdf ? As I understand it, mu1 and mu2 are tangential friction forces applied between body and surface, so that the tangential friction force applied to the body as the body weight when mu=1. <dynamics damping="0.7" friction="100.0"/> is the damping force which is proportional to the velocity of the moving body. What should I do in the urdf to applying the damping force which is proportional to the velocity in the simple sliding box? Below is the sliding box urdf code: |
2014-04-20 06:49:57 -0500 | marked best answer | best practice for multi robot simulation Hi, Could anybody let me know what is the best practice for multi-robot simulation in ROS ? I want to simulate both an aerial vehicle and a ground vehicle in gazebo, and control them for the missions such as path-following and tracking objects. |
2014-04-20 06:49:56 -0500 | marked best answer | error message when running "Quadrotor indoor SLAM demo" Hi, When I tried to run the quadrotor demo here , I got the following error message: Could anybody let me know how to resolve the error message ? Thanks~ |
2014-04-20 06:48:55 -0500 | marked best answer | differences in simulation from gazebo and Matlab Dear, Is this problem related to time in gazebo? |
2014-04-20 06:48:47 -0500 | marked best answer | how to mark the prescribed trajectory in gazebo simulation ? Dear, I was able to make my simple model follow the prescribed position trajectory (circle or infinity shape or any smooth trajectory) in gazebo simulation. One more thing I want to do to show the prescribed trajectory in the gazebo simulation so that I want to show how closely my model follows the given trajectory. What part should I modify or edit ? Do I need to see the world file or look for different world file? |
2014-04-20 06:48:45 -0500 | marked best answer | how to measure an angle? Dear, I want to measure yaw angle (radian). What command should I use ? In my c++ file, I used like this; This yaw angle produce only between -pi and pi. But I want to measure directly the yaw angle in radian without the limitation of -pi and +pi, that is, measure the counter-clockwise one and half circling as +3 pi and the clockwise two circling as -4*pi. One alternative can be coded this way: But the heading angle psi might accumulate some integration error. Do I have to implement more accurate integration method ? |