Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neck_r joint rotate opposite direction #405

Open
taichiH opened this issue May 7, 2019 · 0 comments
Open

neck_r joint rotate opposite direction #405

taichiH opened this issue May 7, 2019 · 0 comments

Comments

@taichiH
Copy link
Contributor

taichiH commented May 7, 2019

For example, set the desired neck_r joint angle to 0.8 rad.
Like the below image, neck_r joint rotates opposite direction.

Screenshot from 2019-05-07 14-41-25
Screenshot from 2019-05-07 14-41-20

rostopic echo /head_controller/state

header: 
  seq: 2129
  stamp: 
    secs: 1557207691
    nsecs: 187799020
  frame_id: ''
joint_names: [neck_y_joint, neck_p_joint, neck_r_joint]
desired: 
  positions: [0.0, 0.0, 0.08]
  velocities: [0.0, 0.0, 0.0]
  accelerations: [0.0, 0.0, 0.0]
  effort: []
  time_from_start: 
    secs: 0
    nsecs:         0
actual: 
  positions: [0.0, 0.0, -0.07998672127723694]
  velocities: [0.0, 0.0, 0.0]
  accelerations: []
  effort: []
  time_from_start: 
    secs: 0
    nsecs:         0
error: 
  positions: [0.0, 0.0, 0.159986721277237]
  velocities: [0.0, 0.0, 0.0]
  accelerations: []
  effort: []
  time_from_start: 
    secs: 0
    nsecs:         0
---

This is the entir sample code.

#include <aero_std/AeroMoveitInterface.hh>

int main(int argc, char **argv)
{
  ros::init(argc, argv, "fk_sample_node");
  ros::NodeHandle nh;
  aero::interface::AeroMoveitInterface::Ptr robot(new aero::interface::AeroMoveitInterface(nh));

  ROS_INFO("reseting robot pose");
  robot->setPoseVariables(aero::pose::reset_manip);
  robot->sendModelAngles(3000);
  sleep(3);

  robot->setRobotStateToCurrentState();

  double neck_r = 0.08;
  aero::joint_angle_map joint_angles;
  robot->getRobotStateVariables(joint_angles);
  joint_angles[aero::joint::neck_r] = neck_r;
  ROS_INFO("neck r moves from %f to %f", joint_angles[aero::joint::neck_r], neck_r);

  ROS_INFO("moveing neck r");
  robot->setRobotStateVariables(joint_angles);
  robot->sendModelAngles(2000);
  sleep(3);

  ROS_INFO("node finished");
  ros::shutdown();
  return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant