Is their any tutorial or link to understand how i can send the joint trajectory commands to a robot at same time. I try to understand this jointtrajectory plugin but its too complicated for me right now and it looks like it is not meant for standalone ros indigo and gazebo.
simultaniously means at the same time how can i send the joint velocity commands, position commands to the robot in one cycle. All the tutorials i've seen i've seen how can i send these commands for individual joint or link. But i have no idea in c++, how can i send the velocity or position commands to the multiple joints at one single cycle. Till now i'm using below code to send velocity command to a single joint:
public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
{
// Safety check
if (_model->GetJointCount() == 0)
{
std::cerr << "Invalid joint count, Velodyne plugin not loaded\n";
return;
}
// Store the model pointer for convenience.
this->model = _model;
// Get the first joint. We are making an assumption about the model
// having one joint that is the rotational joint.
this->joint = _model->GetJoints()[0];
// Setup a P-controller, with a gain of 0.1.
this->pid = common::PID(0.1, 0, 0);
// Apply the P-controller to the joint.
this->model->GetJointController()->SetVelocityPID(
this->joint->GetScopedName(), this->pid);
// Set the joint's target velocity. This target velocity is just
// for demonstration purposes.
this->model->GetJointController()->SetVelocityTarget(
this->joint->GetScopedName(), 10.0);
}
Here the joint with index 0 has been sent a velocity command, i want to send this command to other joint s also but at same time by using some JointTrajectory msgs or something. Here when i try to send this command to each joint by using for look it doesn't seems to work. In this tutorial they have shown how this can be done with python and a gazebo_ros_joint_trajectory_plugin, but i dont know python, and the plugin is little complicated for me to understand since it has functions inherited from so many parent classes.
For example my robot has two joints at position A and B, now i want to move them both at position C and D at certain velocity or move them at one direction at certain velocity but simultaniously not just one by using setposition function described in gazebo api, so i'm little confused right now how exactly i can do it.
Originally posted by dinesh on ROS Answers with karma: 932 on 2016-12-25
Post score: 0
Original comments
Comment by gvdhoorn on 2016-12-26:
Please explain clearly what you mean with "how I can send the joint trajectory commands to a robot at the same time". Which "robot", and what are "the joint trajectory commands"?
Maybe this is an xy-problem: what is it that you actually want to do?
Comment by gvdhoorn on 2016-12-27:
Are you asking how to do this from a Gazebo plugin, or are you trying to control a Gazebo robot from outside Gazebo from ROS?