JenniferBuehler / joint-control-pkgs

Packages to control joints via JointState and JointTrajectory messages
BSD 3-Clause "New" or "Revised" License
18 stars 19 forks source link

Publicar trayectoria en topico #7

Closed jdom1824 closed 5 years ago

jdom1824 commented 5 years ago

Hola Dra. Jennifer, Quiero hacer una trayectoria pero estoy confundido específicamente en que tópico se debe publicar, actualmente lo intento así: rostopic pub /jaco/joint_trajectory_action/ control_msgs/FollowJointTrajectoryAction. He seguido sus tutoriales le agradezco por crearlos me han ayudado mucho. Espero me pueda facilitar un ejemplo, actualmente estoy simulando Gazebo con Jaco_on_table y moveit. Saludo.

JenniferBuehler commented 5 years ago

Hello, I'll reply in English if that's ok. Do I understand correctly that you would like to change the topic of the joint trajectory action? You can do this in a config.yaml file of this format (action_topic) which you can load from the launch file. Does that answer your question?

jdom1824 commented 5 years ago

I understand that the config.yaml file is for execute configure params initial of trajectory. My question is: As public the point of the trajectory? in wich topic? For example move the joints through console is:

rostopic pub /jaco/joint_control sensor_msgs/JointState "header:
  seq: 0
  stamp: {secs: 0, nsecs: 0}
  frame_id: ''
name: ['jaco_arm_0_joint', 'jaco_arm_1_joint', 'jaco_arm_2_joint', 'jaco_arm_3_joint', 'jaco_arm_4_joint', 'jaco_arm_5_joint', 'jaco_finger_joint_0', 'jaco_finger_joint_2', 'jaco_finger_joint_4']                
position: [0,0,0,0,0,0,0,0,0,1.0054422152826525405]
velocity: [0]
effort: [0]" 
publishing and latching message. Press ctrl-C to terminate

I want to do the same but with points x, y, z for the trajectory.

Thanks for answer

JenniferBuehler commented 5 years ago

A trajectory consists of more than one point, so just publishing one message is a bit cumbersome. You could do a

rostopic pub /joint_trajectory_action control_msgs/FollowJointTrajectoryAction <hit tab>

and it would give you a template, but it's probably easier to use if you write a little helper program which builds the trajectory message based on your X/Y/Z command line parameter input. The first point in the trajectory should be the robot's current joint state, and the second point could be your target points. This could be something like this program. However to do it properly, a motion planner (e.g. using MoveIt) should be used to compute the trajectory. See also this tutorial.

Does that answer your question?