Home | Tutorials | Wiki | Issues
Ask Your Question

Bharadwaj Ramesh's profile - activity

2019-04-17 08:54:52 -0500 received badge  Favorite Question (source)
2015-10-31 12:31:02 -0500 marked best answer 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

If not what tutorials must I follow for me to create a controller for my robot ?

I do not find enough document to follow things around, can someone please explain .

2015-10-31 12:30:40 -0500 marked best answer DRC sim - Atlas loading error

I have the DRCSim installed following the instructions given on the page http://gazebosim.org/wiki/InstallDRC I run gazebo fom the terminal and the GUI opens but when i try to load the robot Atlas into it, it gets stuck and says the following error.

Error [gazeboroslaser.cpp:153] Not loading plugin since ROS hasn't been properly initialized.
Try starting gazebo with ros plugin:

gazebo -s libgazeborosapi.so

Error [gazeboroscamera_utils.cpp:234] Not loading plugin since ROS hasn't been properly

initialized. Try starting gazebo with ros plugin:

gazebo -s libgazeborosapi.so

Error [gazeboroscamera_utils.cpp:234] Not loading plugin since ROS hasn't been properly

initialized. Try starting gazebo with ros plugin:

gazebo -s libgazeborosapi.so

Error [AtlasPlugin.cc:135] rfootcontact_sensor not found

Error [AtlasPlugin.cc:144] lfootcontact_sensor not found

Error [AtlasPlugin.cc:159] Not loading plugin since ROS hasn't been properly initialized. Try

starting gazebo with ros plugin:

gazebo -s libgazeborosapi.so

Error [gazeborosjoint_trajectory.cpp:108] Not loading plugin since ROS hasn't been properly

initialized. Try starting gazebo with ros plugin:

gazebo -s libgazeborosapi.so

Error [gazeboroscontroller_manager.cpp:127] Not loading plugin since ROS hasn't been properly

initialized. Try starting gazebo with ros plugin:

gazebo -s libgazeborosapi.so

Error [gazeborosimu.cpp:124] Not loading plugin since ROS hasn't been properly initialized. Try

starting gazebo with ros plugin:

gazebo -s libgazeborosapi.so

I have been using gazebo for 2 weeks and it was working fine. I have this problem from only today, now I am not able to run this world as well

roslanch atlas_utils atlas.launch

It loads and then just dissappears.

Can someone please help me .

THank YOu

2015-10-31 12:30:21 -0500 marked best answer Gazebo-1.6 Update : build probem

I recently updated drcsim and gazebo to drcsim-2.3 and gazebo-1.6. SInce then I am unable to build controllers. I think it is not able to find the include files.

/home/bharadwajramesh/gazeboplugintutorial/hello_world.cc:1:21: fatal error: gazebo.hh: No such file or directory

What is the problem here, am I missing something or is there something I should do ?

-thanks Bharadwaj

2015-10-31 12:30:16 -0500 marked best answer Error in Creating a new world similar to the atlas_utils pkg to make a robot stand up

I am trying to create a new world with a new humanoid robot (similar to the atlas )model initialed in it. My main aim is to keep the robot standing first.

I only have the model urdf file.I want to create a controller that gives the joints a inital torque to keep the robot standing. I use the following tutorial to create my files.

http://gazebosim.org/wiki/Tutorials/drcsim/1.3/changingcontrollerconfiguration

I try to replicate the atlas_utils package for my robot and I get a error.

I first created a mysim.lauch file in ~/ros/hubo_trial/launch/ directory,which has the following script

    <launch>

      <!-- start gazebo with the Hubo -->
      <include file="$(find hubo_utils)/launch/hubo_no_controllers.launch"/>

      <!-- Controller Manager -->
      <include file="$(find pr2_controller_manager)/controller_manager.launch" />

      <!-- Fake Calibration -->
      <node pkg="rostopic" type="rostopic" name="fake_joint_calibration"
            args="pub /calibrated std_msgs/Bool true" />

      <!-- Whole Body -->
      <rosparam command="load" file="$(find hubo)/ros/whole_body_trajectory_controller.yaml" />

       <!-- Controllers that come up started -->
       <node name="hubo_urdf_controller_spawner"
          pkg="pr2_controller_manager" type="spawner" output="screen"
          args="--wait-for=/calibrated Hubo_controller" />

    </launch>

my hubonocontrollers.launch file is as follows

    <launch>

      <arg name="gzname" default="gazebo"/>
      <arg name="gzworld" default="hubo.world"/>
      <param name="/use_sim_time" type="bool" value="true"/>

      <!-- start gazebo with the Hubo -->
      <node name="gazebo" pkg="hubo_utils" type="run_$(arg gzname)" args="$(arg gzworld)" output="screen" />

      <!-- Robot Description -->
      <param name="robot_description" textfile="$(find hubo)/model.urdf"/>

    </launch>

my whole_body_trajectory_controller.yaml is as follows

Hubo_controller:
  type: "robot_mechanism_controllers/JointTrajectoryActionController"
  joints:
    - LHY
    - LHR
    - LHP
    - LKP
    - LAP
    - LAR
    - RHY
    - RHR
    - RHP
    - RKP
    - RAP
    - RAR
  gains:
    LHY: {p:     5.0, d:  0.01, i:   0.0, i_clamp:    0.0}
    LHR: {p:   100.0, d:   1.0, i:   0.0, i_clamp:    0.0}
    LHP: {p:  2000.0, d:  10.0, i:   0.0, i_clamp:    0.0}
    LKP: {p:  1000.0, d:  10.0, i:   0.0, i_clamp:    0.0}
    LAP: {p:   900.0, d:   8.0, i:   0.0, i_clamp:    0.0}
    LAR: {p:   300.0, d:   2.0, i:   0.0, i_clamp:    0.0}
    RHY: {p:     5.0, d:  0.01, i:   0.0, i_clamp:    0.0}
    RHR: {p:   100.0, d:   1.0, i:   0.0, i_clamp:    0.0}
    RHP: {p:  2000.0, d:  10.0, i:   0.0, i_clamp:    0.0}
    RKP: {p:  1000.0, d:  10.0, i:   0.0, i_clamp:    0.0}
    RAP: {p:   900.0, d:   8.0, i:   0.0, i_clamp:    0.0}
    RAR: {p:   300.0, d:   2.0, i:   0.0, i_clamp:    0.0}
  joint_trajectory_action_node:
    joints:
    - LHY
    - LHR
    - LHP
    - LKP
    - LAP
    - LAR
    - RHY
    - RHR
    - RHP
    - RKP
    - RAP
    - RAR
  constraints:
      goal_time: 0.0
      LHY:
        goal: 0.02
      LHR:
        goal: 0.02
      LHP:
        goal: 0.02
      LKP:
        goal: 0.02
      LAP:
        goal: 0.02
      LAR:
        goal: 0.02
      RHY:
        goal: 0.02
      RHR:
        goal: 0.02
      RHP:
        goal: 0.02
      RKP:
        goal: 0.02
      RAP:
        goal: 0.02
      RAR:
        goal: 0.02

Are these the only 3 files that I need to set up the pkage?

I run it saying roslaunch hubo_trial mysim.launch ... (more)

2015-10-31 12:30:10 -0500 marked best answer What does Update Rate control?

I have an SDF file, in which i have the following snippet:

<physics type='ode'>
  <max_step_size>0.001000</max_step_size>
  <real_time_factor>1.000000</real_time_factor>
  <real_time_update_rate>1000.000000</real_time_update_rate>
  <gravity>0.000000 0.000000 -9.800000</gravity>
</physics>

Here what does the realtimeupdate_rate parameter do ? Does 1000 mean it updates 1000 time per simulation second or a real world second ? If I want to control the update rate : i.e I have a controller that controls my model. This controller basically controls the position of a joint. But I want it to move at the rate I want it to. say for ex : I want to move 1 radian per second. and I do only a .1 radian increment in my plugin. Which means I need only 10 increments per real world second. So can this be achieved by settin the parameter as

  <real_time_update_rate>10.00000000</real_time_update_rate>

Does that mean my plugin runs only 10 times/ REAL WORLD SECOND ?

2015-10-31 12:24:30 -0500 marked best answer Using opencv with Gazebo !

I am planning to use the the camera sensor on Gazebo and use the image from the sensor to perfrom simple image processing like tracking a ball etc. I am planning to use OpenCV libraries. I am very new with opencv, so will I be able to use Opencv libraries ? If so what are the things that I should take care off. I just installed opencv from the following link.

http://docs.opencv.org/trunk/doc/tutorials/introduction/linuxinstall/linuxinstall.html#linux-installation

-Thanks Bharadwaj

2015-10-31 12:13:10 -0500 marked best answer SetAngle/SetPosition having erratic effect on Robot model.

I have a robot model and I am trying to generate trajectories for each joint of the model. I wan to initilize all the joints to 0. I am using the SetAngle(I also tried set SetJointPosition) to do this for me.

1)All the joints are initially at 0. but as simulation time goes on , the robot as a whole starts moving. i.e it translates Why do I see such a behavior ?

2)After a few seconds the robot completely looses stability and all the joints start to move(change from 0). What is the reason being this ? THough all that the controller does is keeps setting the angle for each joint to 0 every loop iteration.

Is there a solution or a way around this ? I have tried using the PID controller but the problem with it is I do not get good response and I do not reach my exact pointin the required time I want. I have about 10 DOF to control so setting all the right PID gains seem to be tough. Is there a way around this ?

Thanks

2014-08-13 23:34:22 -0500 received badge  Teacher (source)
2013-10-02 19:06:58 -0500 received badge  Famous Question (source)
2013-07-23 09:37:33 -0500 received badge  Famous Question (source)
2013-07-09 01:28:11 -0500 received badge  Famous Question (source)
2013-06-27 09:20:38 -0500 received badge  Famous Question (source)
2013-06-27 09:20:38 -0500 received badge  Notable Question (source)
2013-06-03 17:42:42 -0500 received badge  Famous Question (source)
2013-06-02 14:40:09 -0500 received badge  Notable Question (source)
2013-06-02 14:40:09 -0500 received badge  Popular Question (source)
2013-06-01 08:10:55 -0500 received badge  Famous Question (source)
2013-05-27 05:29:54 -0500 received badge  Notable Question (source)
2013-05-24 19:58:13 -0500 received badge  Famous Question (source)
2013-05-13 21:53:22 -0500 commented answer Simple Subscribing plugin

Yeah, I dint know that I did not need to create a custom message. It was my lack of C++ knowledge that made it difficult to understand.

2013-05-12 19:30:29 -0500 answered a question Simple Subscribing plugin

I have it fixed now. I am using a Vector2D type of message to transmit. here is the subscriber plugin:

#include <gazebo/transport/transport.hh>
#include <gazebo/msgs/msgs.hh>
#include <gazebo/gazebo.hh>

#include <iostream>

/////////////////////////////////////////////////
// Function is called everytime a message is received.
typedef const boost::shared_ptr<const gazebo::msgs::Vector2d> VectorTwoDPtr;
void cb(VectorTwoDPtr &_msg)
{
  // Dump the message contents to stdout.
  std::cout << "x : " <<_msg->x() << "\n";
  std::cout << "y : " <<_msg->y() << "\n";
}

/////////////////////////////////////////////////
int main(int _argc, char **_argv)
{
  // Load gazebo
  gazebo::load(_argc, _argv);

  gazebo::run();

  // Create our node for communication
  gazebo::transport::NodePtr node(new gazebo::transport::Node());
  node->Init();

  // Listen to Gazebo world_stats topic
  gazebo::transport::SubscriberPtr sub = node->Subscribe("~/pose_example1", cb);

  // Busy wait loop...replace with your own code as needed.
  while (true)
    gazebo::common::Time::MSleep(10);

  // Make sure to shut everything down.
  gazebo::transport::fini();
}

And my publisher looks like :

#include <gazebo/gazebo.hh>
#include <gazebo/transport/transport.hh>
#include <gazebo/msgs/msgs.hh>
#include <math/gzmath.hh>

#include <iostream>


/////////////////////////////////////////////////
int main(int _argc, char **_argv)
{
  // Load gazebo
  gazebo::load(_argc, _argv);

  // Create our node for communication
  gazebo::transport::NodePtr node(new gazebo::transport::Node());
  node->Init();

  // Start transport
  gazebo::transport::run();

  // Publish to a Gazebo topic
  gazebo::transport::PublisherPtr pub =
    node->Advertise<gazebo::msgs::Vector2d>("~/pose_example1");

  // Wait for a subscriber to connect
  pub->WaitForConnection();

  // Publisher loop...replace with your own code.
  while (true)
  {
    gazebo::common::Time::MSleep(100);
    gazebo::math::Vector2d vect(5, 7);
    gazebo::msgs::Vector2d msg;
    gazebo::msgs::Set(&msg, vect);
    pub->Publish(msg);
  }

  // Make sure to shut everything down.
  gazebo::transport::fini();
}

This is not a program I completely wrote but it was a program that I slightly modified based on the example given in this link :

https://bitbucket.org/osrf/gazebo/src...

This was just a simple program that I wanted to implement so that I understand how to communicate.

Thank you scpeters for all your patient replies and your suggestions which is what I finally planned to use.

2013-05-09 11:16:37 -0500 received badge  Notable Question (source)
2013-05-07 23:41:42 -0500 received badge  Popular Question (source)
2013-05-07 21:43:10 -0500 commented question Simple Subscribing plugin

Even if I publish as a Vector2d message how Do I still subscribing to a TOPIC.

2013-05-07 15:34:44 -0500 commented answer Subscribe from C++ external file

HI, I am trying to write a simple subscriber. I am pretty much a beginner with Gazebo and with C++. Here is my question. http://answers.gazebosim.org/question/2676/simple-subscribing-plugin/ Can you please help me with it. Any help is appreciated. Thanks

2013-05-07 15:30:40 -0500 commented question Simple Subscribing plugin

I did try moving the type def outside but that does not help. The above tutorial you shared seems too complicated for me since I am pretty much a beginner with c++. I try follwoing this tutorial here https://bitbucket.org/osrf/gazebo/src/256f98f2318bf2078e708f069367f1b71549ffb6/examples/stand_alone/listener/listener.cc?at=default Does a subscribed need to defined inside a class ? In the above ex. I shared they do not use a class. Can I write up such a code that will subscribe.

2013-05-06 22:25:00 -0500 commented question Simple Subscribing plugin

basically I need the code that will help me extract data from a topic and use this data. like stor them in variables for use. Do I need to create a separate function for this ? I would be greatly helpfull if I can get a sample code that does this.

2013-05-06 22:22:26 -0500 commented question Simple Subscribing plugin

fixed that but only 1 less error !

2013-05-06 07:51:29 -0500 received badge  Popular Question (source)
2013-05-04 10:03:35 -0500 commented answer Communicating between a Camera Plugin and a Model Plugin

Hay cah you please check this post and help me with figuring what is wrong : http://answers.gazebosim.org/question/2676/simple-subscribing-plugin/

2013-05-04 09:46:32 -0500 answered a question What is the difference between a Plugin and a Sensor

A plugin is a piece of code that is used to problematically change things in a simulation. U have different kinds of plugins as said here : http://gazebosim.org/wiki/Tutorials/1...

A sensor is a device that can retrieve information from the simulated environment. U can write a sensor plugin in which you can do things with the sensor like retrive data from the sensor.

What I think they mean in the like u shared is that the sensor is not controller using a sensor plugin but rather a model plugin.

-Feel free to ask more

2013-05-03 23:28:10 -0500 asked a question Simple Subscribing plugin

I am writing a simple subscriber program that I want which I want to subscribe to a topic that I publish. I have the publisher writtten and It works. But I am not able to even compile the subscriber : here is the subscriber program :

#include <gazebo.hh>
#include <transport/transport.hh>
#include <msgs/msgs.hh>
#include <iostream>

#include "custom.pb.h"
void subs(CustomPtr &msg)
{
  std::cout << "Recieved { " << msg->my_data << "}" ;
}
int main(int _argc, char **_argv)
{

  typedef const boost::shared_ptr<const my_msgs::msgs::Custom> CustomPtr

  // loading gazebo
  gazebo::load(_argc,_argv);
  int i;
  gazebo::run();

  gazebo::transport::NodePtr node(new gazebo::transport::Node());
  node->Init ();
  // start transportation
  gazebo::transport::run();

  // Subscribe to a topic
  gazebo::transport::SubscriberPtr sub = node->Subscribe("~/testing_example", subs);

  //publishing loop
  while (true)
  {


  }

  // shutting down
  gazebo::transport::fini();
}

This is the error I get :

/home/bharadwajramesh/Gazebo_tests/subscriber/subscriber.cc:7:11: error: variable or field ‘subs’ declared void
/home/bharadwajramesh/Gazebo_tests/subscriber/subscriber.cc:7:11: error: ‘CustomPtr’ was not declared in this scope
/home/bharadwajramesh/Gazebo_tests/subscriber/subscriber.cc:7:22: error: ‘msg’ was not declared in this scope
/home/bharadwajramesh/Gazebo_tests/subscriber/subscriber.cc: In function ‘int main(int, char**)’:
/home/bharadwajramesh/Gazebo_tests/subscriber/subscriber.cc:14:54: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
/home/bharadwajramesh/Gazebo_tests/subscriber/subscriber.cc:14:62: error: template argument 1 is invalid
/home/bharadwajramesh/Gazebo_tests/subscriber/subscriber.cc:17:3: error: expected initializer before ‘gazebo’
/home/bharadwajramesh/Gazebo_tests/subscriber/subscriber.cc:27:79: error: ‘subs’ was not declared in this scope
make[2]: *** [CMakeFiles/subscriber.dir/subscriber.cc.o] Error 1
make[1]: *** [CMakeFiles/subscriber.dir/all] Error 2
make: *** [all] Error 2

"testing_example" is the node that I publish on.

I do now know how to access the data that is publish over the node, how do I write a simple function that will do this for me. Please help.

-Thanks Bharadwaj

2013-05-03 23:04:17 -0500 received badge  Notable Question (source)
2013-05-03 21:13:55 -0500 marked best answer Communicating between a Camera Plugin and a Model Plugin

My goal is to use the camera to plugin and develop a simple image processing program which finds a red ball in the frame and it determines the center position of the ball.

Once my camera determines these coordinates I need a model plugin to work based on the position of the ball. Basically determining the angle to turn.

Q1 ) How do i communicate between these two plugins ?

Q2 ) Are there tutorials for this ?

-Thanks Bharadwaj

2013-05-03 21:13:43 -0500 received badge  Commentator
2013-05-03 21:13:43 -0500 commented answer Communicating between a Camera Plugin and a Model Plugin

I'm tryin to make a custom message using the following tutorial,but its not workin

https://bitbucket.org/osrf/gazebo/src/256f98f2318b/examples/plugins/custom_messages?at=default

I tried changing the main(the one that connects to the .cc file) CMakeLists.txt file to:

linkdirectories(${GAZEBOLIBRARYDIRS} ${CMAKECURRENTBINARYDIR}/msgs)

I did that change to CMake file from the following tutorial :

http://gazebosim.org/wiki/Tutorials/1.4/custom_messages do you kno wats wrong