Ask Your Question

Bharadwaj's profile - activity

2021-05-12 03:54:49 -0500 received badge  Famous Question (source)
2015-11-13 02:37:06 -0500 received badge  Famous Question (source)
2015-10-14 16:15:38 -0500 received badge  Notable Question (source)
2015-10-14 16:15:38 -0500 received badge  Popular Question (source)
2015-02-16 08:34:40 -0500 received badge  Notable Question (source)
2014-05-05 23:27:47 -0500 received badge  Famous Question (source)
2014-04-03 17:41:52 -0500 commented answer ROS Rviz groovy segfault and assertion fail

Worked for me as well. - lubuntu 12.04 - ROS Groovy

2014-03-31 18:25:31 -0500 received badge  Scholar (source)
2014-03-31 18:24:36 -0500 answered a question Acquiring new data/message from a subscribed topic

I had my problem fixed. I used the second method that I discussed in my question( the one that says b).

From my understand the issue could be that no more messages/data was being available on that topic. Thus there was no data for the subscriber to trigger the callback.

Thus I simply check if the callback was called or not using a variable(global) before calling spinOnce and change the variable value inside the callback function, and after my spinOnce function i check the value of this variable.

2014-03-31 07:45:31 -0500 received badge  Notable Question (source)
2014-03-30 02:57:03 -0500 commented answer Acquiring new data/message from a subscribed topic

Dear Mr.McMurdo, I appreciate ur detailed reply. I have update my question based on your reply. It does help me get a better understanding but does not solve my issue. Can u pls give me the right link to study about spinOnce function standing alone. I think this might be my issue.

2014-03-30 00:14:12 -0500 received badge  Popular Question (source)
2014-03-29 16:06:45 -0500 asked a question Acquiring new data/message from a subscribed topic

I have subscribed to the following topic

 /camera/depth_registered/points

I have a callback function defined as the following in a c++ file :

ros::Subscriber sub = nh.subscribe ( "/camera/depth_registered/points", 1, process_cloud );

1) I want to obtain the latest data from the above topic when I want it. Is there a way to acquire the latest data from the topic whenever I want inside my callback function ?

I also tried a workaround using the ros::spinOnce() function. But sometimes my callback function does not get called.

2) When and why will this happen ? - the callback function not being called.

3) Is there a way to check if the callback got called when using the ros::spinOnce() ?

  • proccess_cloud is the only callback function i have in my program
  • I am using ros - groovy on a Ubuntu-12.04 machine

I appreciate any help anyone can provide. Please post if you require anymore information.

___ UPDATE ____

Essentially this is what I am trying to do :

1) I have a UDP communication setup in the above program, between the computer that runs the above code that I am having an issue with, I will call this PC 1

2) PC2 sends a request to PC1 over UDP communication - at which time i want to acquire latest data from my Prime Sense Carmine 1.09 sensor.

3) Thus in my above code, in PC1, I want to wait for this UDP request and then acquire a data from the prime Sense sensor and process the data.

I have tried two versions of code to accomplish the above problem

a) 1st version - I use the UDP - recvfrom function inside the callback function : thus the code essentially gets held at this line waiting to request from PC2(which how the recvfrom function works). And when it recieves the request from PC2 rest of the processing occurs - thus working on old data. Which led to my question here as to how to obtain new data in my callback function.

b) To work around the above problem I came up with the 2nd version : Here I use the spinOnce function , thus in my main function I wait for the request from PC2 using the recvfrom function. And then I use spinOnce function - to run my callback function. All this essentially inside a while loop. - But in this case sometimes the callback does not get called sometime. - Also in this case is it ensured that the latest available data from my topic used ?

And my 1st line in the callback function a print to the command line saying I was called ( using std::cout ). Which is how I figure out that the callback does not get called( in my 2nd case).

I am using the following command to obtain data from the prime sense sensor.

roslaunch openni_launch openni.launch

Also is this the best way to obtain data from the prime sense sensor

2014-03-29 15:25:46 -0500 commented answer Error adding controller script in simple urdf model to be simulated on GAZEBO.

@salman :Sorry for my late reply. Yeah I did figure out to control joints when we have the URDF file. I was searching for answers in the wrong location. Follow the Gazebo tutorials and you will be able to arrive at the right answers. http://gazebosim.org/wiki/Tutorials/1.3/intermediate/control_model

2014-01-16 01:21:40 -0500 received badge  Notable Question (source)
2013-09-05 12:16:35 -0500 received badge  Notable Question (source)
2013-07-02 17:47:53 -0500 received badge  Popular Question (source)
2013-06-26 09:28:21 -0500 received badge  Nice Question (source)
2013-04-22 09:44:31 -0500 received badge  Popular Question (source)
2013-04-02 03:32:00 -0500 received badge  Famous Question (source)
2013-04-01 11:09:12 -0500 commented question Gazebo: no friction, no self collide (self collision not working)

@hsu : I am using Gazebo-1.3 : I am unable to locate the ODELink.cc file. Is it available in Gazebo-1.3 ? Is so can you please tell me where I should find it or how I should fix it . Thanks .

2013-02-19 12:34:30 -0500 received badge  Notable Question (source)
2013-02-13 06:57:11 -0500 commented answer Error adding controller script in simple urdf model to be simulated on GAZEBO.

@davinci : I have added all my launch files in the question , Can you please tell how I should change the node parameters. Can you also tell me if with this can I simulate the robot and the controller on GAZEBO, if now can you tell me what are the elements I have to change , Thanks a lot

2013-02-13 06:32:36 -0500 received badge  Popular Question (source)
2013-02-13 05:05:07 -0500 received badge  Supporter (source)
2013-02-13 03:41:33 -0500 commented answer Error adding controller script in simple urdf model to be simulated on GAZEBO.

<node name="spawn_single_link" pkg="gazebo" type="spawn_model" args="-urdf -param robot_description -model pr2 -z 0.5" respawn="false" output="screen" /> Is this what I should use ? I am not able to follow what these two are doing. Can you please tell what each element is doing ? Thank You

2013-02-13 03:39:55 -0500 commented answer Error adding controller script in simple urdf model to be simulated on GAZEBO.

<node name="my_controller_spawner" pkg="pr2_controller_manager" type="spawner" output="screen" args="my_controller_name" /> This is what I use in my launch file to launch the robot with the controller started with it.

2013-02-12 17:25:33 -0500 commented answer can i use a pr2 controller for my own urdf

@Lorenz : I am trying the same thing. I face a different error. I have a question posted in the following like, can you please check and see if kno what the error is telling me http://answers.ros.org/question/55082/error-adding-controller-script-in-simple-urdf-model-to-be-simulated-on-gazebo/

2013-02-12 17:17:29 -0500 asked a question Controlling a urdf model on Gazebo unsing pr2_mechanism package

I have a urdf robot model that I want to simulate and control on gazebo. I need to know if I can use the pr2_mechanism package to control my robot on the gazebo.

If I can can I simply follow the tutorials given in the ROS tutorials ? If now what are the what should I using ?

Can I use the following tutorial and apply it for a joint that I want to control and see it on Gazebo :

http://ros.org/wiki/pr2_mechanism/Tutorial/Writing%20a%20realtime%20joint%20controller

http://ros.org/wiki/pr2_mechanism/Tutorials/Running%20a%20realtime%20joint%20controller

2013-02-12 16:45:10 -0500 asked a question Error adding controller script in simple urdf model to be simulated on GAZEBO.

I have URDF model of the single leg of a robot. My goal is to be able to give the joints a effort command and make it stand eventually. My URDF file is as follows.

<?xml version="1.0" ?>
<robot name="huboleg" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <link name="Body_LHP">
    <inertial>
      <mass value="2.8201"/>
      <inertia ixx="0.0295102" ixy="0.000184399" ixz="-0.000370291" iyy="0.0273771" iyz="0.00065658" izz="0.00838035"/>
      <origin xyz="0.0195049 -0.0595775 -0.175202"/>
    </inertial>
    <visual>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LHP_vis.dae"/>
      </geometry>
      <material name="random">
        <color rgba="0.800000 0.800000 0.500000 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LHP_col.dae"/>
      </geometry>
    </collision>
  </link>
  <link name="Body_LKP">
    <inertial>
      <mass value="1.80912"/>
      <inertia ixx="0.0232156" ixy="0.000251648" ixz="-0.00129343" iyy="0.0208342" iyz="0.00278068" izz="0.0059204"/>
      <origin xyz="0.0128254 -0.00727567 -0.171431"/>
    </inertial>
    <visual>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LKP_vis.dae"/>
      </geometry>
      <material name="random">
        <color rgba="0.800000 0.800000 0.500000 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LKP_col.dae"/>
      </geometry>
    </collision>
  </link>
  <link name="Body_LAP">
    <inertial>
      <mass value="1.63501"/>
      <inertia ixx="0.00231659" ixy="1.87402e-05" ixz="0.000369899" iyy="0.00330411" iyz="6.38153e-05" izz="0.00279495"/>
      <origin xyz="0.0198702 -0.0459693 0.0115069"/>
    </inertial>
    <visual>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LAP_vis.dae"/>
      </geometry>
      <material name="random">
        <color rgba="0.800000 0.800000 0.500000 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LAP_col.dae"/>
      </geometry>
    </collision>
  </link>
  <link name="Body_LAR">
    <inertial>
      <mass value="1.20318"/>
      <inertia ixx="0.00295183" ixy="3.23211e-05" ixz="0.000141769" iyy="0.00524792" iyz="5.95404e-05" izz="0.00516817"/>
      <origin xyz="-0.0515094 0.00216398 -0.0693881"/>
    </inertial>
    <visual>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LAR_vis.dae"/>
      </geometry>
      <material name="random">
        <color rgba="0.800000 0.800000 0.500000 1"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <mesh filename="package://hubo_leg/meshes/Body_LAR_col.dae"/>
      </geometry>
    </collision>
  </link>
  <joint name="LKP" type="revolute">
    <origin rpy="0 -0 0" xyz="0.000766364 -0.0445011 -0.280007"/>
    <parent link="Body_LHP"/>
    <child link="Body_LKP"/>
    <axis xyz="0 1 0"/>
    <limit effort="10.0" lower="-0.0698132" upper="2.60054" velocity="1.0"/>
  </joint>
  <joint name="LAP" type="revolute">
    <origin rpy="0 -0 0" xyz="7.20248e-06 0.0247555 -0.279942"/>
    <parent link="Body_LKP"/>
    <child link="Body_LAP"/>
    <axis xyz="0 1 0"/>
    <limit effort="10.0" lower="-1.29154" upper="1.69297" velocity="1.0"/>
  </joint>
  <joint name="LAR" type="revolute">
    <origin rpy="0 -0 0" xyz="0.0711787 -0.0466006 -1.04e-10"/>
    <parent link="Body_LAP"/>
    <child link="Body_LAR"/>
    <axis xyz="1 0 0"/>
    <limit effort="10.0" lower="-0.191986" upper="0.191986" velocity="1.0"/>
  </joint>
  <gazebo>
    <!-- robot model offset -->
    <pose>0 0 .66 0 0 0</pose>
  </gazebo>
  <transmission name="LKP_trans" type="pr2_mechanism_model/SimpleTransmission">
    <actuator name="LKP_motor" />
    <joint name="LKP" />
    <mechanicalReduction>1</mechanicalReduction>
    <motorTorqueConstant>1</motorTorqueConstant>
  </transmission>
  <transmission name="LAP_trans" type ...
(more)
2013-02-11 17:20:38 -0500 received badge  Commentator
2013-02-11 17:19:03 -0500 commented answer Does every joint need an actuator and transmission?

Hay MartinW, are you able to control your URDF model even without the <gazebo> <controller:gazebo_ros_controller_manager

2013-02-11 16:05:44 -0500 commented answer Writing a realtime joint controller [Tutorial]

MartinW Can you tell me which lib folder I should check, I am particularly trying the writing a realtim joint controller. I dont know where I should look. And what shuold I check in my CMakefile.text file?

2013-02-11 16:01:23 -0500 commented answer Writing a realtime joint controller [Tutorial]

I did add the above gazebo elements in the urdf file and I get that error . Do you know what those error mean ?

2013-02-10 18:01:26 -0500 received badge  Editor (source)
2013-02-10 17:44:25 -0500 asked a question Controlling a single joint- pr2_control_manager in gazebo

I am trying to learn the way to control a robot, I want to start off with trying to control a single joint first. I have a simple urdf model with 2 links and a joint . I want to load it on gazebo simulator. I want to know if I can control it using the PR2_control_manager.

Is the controller useable only on the PR2 model ? I have read that it can used on PR2 like models . What does that mean? MY eventual goal is to design a controller for a humanoid robot, which is similar to the Atlas robot. for which I am starting with the designing of a controller for a single joint.

2013-02-09 04:01:23 -0500 answered a question Writing a realtime joint controller [Tutorial]

Hi, I too am facing the same problem. I have a urdf with the transmission elements in it. I tried to implement the a single joint control on it. I created a launch file and I open my model using roslaunch. I open a new terminal n follow the commands in the "running a real time joint controller" I can see my xml file in the plugin list but I do not see a .so file in the "lib" directory. Infact I do not know which lib directory I should check for it.

And do u need to add the description of the plugin in the urdf file ?

<plugin>
...
...
....
</plugin>

do u need those lines of script in the urdf file for you to be able to control a joint even if u are trying to control it by running the controller seperately like in the tutorial?

okay guys I added the following script in the urdf file

<gazebo>
   <controller:gazebo_ros_controller_manager name="gazebo_ros_controller_manager" plugin="libgazebo_ros_controller_manager.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>1000.0</updateRate>
      <interface:audio name="gazebo_ros_controller_manager_dummy_iface" />
    </controller:gazebo_ros_controller_manager>
  </gazebo>

I added this to the urdf file and I ran the model and I get a bunch of errors.

Error [parser.cc:696] XML Element[controller:gazebo_ros_controller_manager], child of element[model] not defined in SDF. Ignoring.[model]
Error [parser.cc:687] Error reading element <model>
Error [parser.cc:370] Unable to read element <sdf>
Error [parser.cc:292] parse as old deprecated model file failed.
Error [parser.cc:620] Unable to read file[/usr/share/drcsim-1.3/models/hubo_leg/model.urdf]
Error [parser.cc:687] Error reading element <world>
Error [parser.cc:370] Unable to read element <sdf>
Error:   Could not find the 'robot' element in the xml file
         at line 61 in /tmp/buildd/ros-fuerte-urdfdom-0.2.3-1precise-20121011-0155/urdf_parser/src/model.cpp
Error [parser_urdf.cc:1529] Unable to call parseURDF on robot model
Warning [parser.cc:378] SDF has no <sdf> element in file[urdf file]
Error [parser.cc:292] parse as old deprecated model file failed.
Error [Server.cc:220] Unable to read sdf file[hubo_leg.world]

I am not able to understand what these errors are telling me. Can we use the PR2 controllers on a urdf model and open it up in gazeb ?

2013-02-09 03:48:54 -0500 commented answer Does every joint need an actuator and transmission?

Hi, I too am trying to impliment the PR2 controllers on my own robot. The urdf example link u pasted above is also a non-pr2 model and they use the pr2 controllers on it. I believe it should work .

2013-02-09 03:48:52 -0500 commented answer Does every joint need an actuator and transmission?

Hi, I too am trying to impliment the PR2 controllers on my own robot. The urdf example link u pasted above is also a non-pr2 model and they use the pr2 controllers on it. I believe it should work .

2013-02-05 01:00:47 -0500 received badge  Popular Question (source)
2013-01-31 15:41:24 -0500 asked a question How does a pkg communicate with the yaml file

The following tutorial how does the package communicate with the yaml file ?

http://ros.org/wiki/pr2_mechanism/Tutorials/SImple%20URDF-Controller%20Example

2013-01-29 02:49:18 -0500 received badge  Student (source)