ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS-I trajectory downloading using TYPE 11 instead of 12?

asked 2017-11-29 08:30:23 -0500

ManMan88 gravatar image

updated 2017-11-29 08:32:29 -0500

I want to use the trajectory downloading method in order to send trajectory commands to my robot controller. As written below, the trajectory downloading method should use the Joint trajectory message (JOINT_TRAJ):

JOINT_TRAJ_PT = 11,  //Joint trajectory point message (typically for streaming)
JOINT_TRAJ = 12,      //Joint trajectory message (typically for trajectory downloading)

However, the JointTrajectoryDownloader class used in the generic_joint_downloader_node.cpp, has a method send_to_robot which converts each Joint trajectory point from the Joint trajectory array into a simple message and sends it (with type JOINT_TRAJ_PT = 11)

A piece of code from the send_to_robot method:

for (int i = 0; i < (int)points.size(); ++i)
  {
    ROS_DEBUG("Sending joints trajectory point[%d]", i);

    points[i].toTopic(msg);
    bool ptRslt = this->connection_->sendMsg(msg);
    if (ptRslt)
      ROS_DEBUG("Point[%d] sent to controller", i);
    else
      ROS_WARN("Failed sent joint point, skipping point");

    rslt &= ptRslt;
  }

So I don't understand how should I create a message handler for the JOINT_TRAJ type if what the server gets is only JOINT_TRAJ_PT messages.

An othere matter, this send_to_robot method adds a sequence to the first and last JOINT_TRAJ_PT messages so it would be possible to know where the path starts and where it ends:

 // The first and last points are assigned special sequence values
  points.begin()->setSequence(SpecialSeqValues::START_TRAJECTORY_DOWNLOAD);
  points.back().setSequence(SpecialSeqValues::END_TRAJECTORY);

But I don't understand how could my massage handler know how to read this sequence from the sent ByteArray. this sequence is not included in one of the typical simple message types, so how could I know if the integer I'm bytes I'm reading are sequence or joint data?

I desperately need help here, thank you!

edit retag flag offensive close merge delete

Comments

As written below, the trajectory downloading method should use the Joint trajectory message (JOINT_TRAJ)

you may feel this is nitpicking, but there is no obligation here. Note the word typically, which expresses a possibility that is probably true, but doesn't have to be.

gvdhoorn gravatar image gvdhoorn  ( 2017-11-29 16:17:40 -0500 )edit
1

As to the rest: in order to avoid a possible xy-problem, could you please tell us what you are actually trying to achieve?

gvdhoorn gravatar image gvdhoorn  ( 2017-11-29 16:33:36 -0500 )edit

I'm trying to create a driver (as ROS-I defines it) for a robot. I have a RT motion controller and I want it to communicate with ROS over TCP with simple messages. I want the communication to be "trajectory downloading" for the moment.

ManMan88 gravatar image ManMan88  ( 2017-11-30 03:13:23 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-30 04:13:53 -0500

ManMan88 gravatar image

O.K I was able to create a Joint trajectory point handler and it works fine (and reads the sequence number fine). As written here: http://wiki.ros.org/simple_message#Jo... , there is a sequence number, so it was my mistake, sorry.

If someone gets stuck on it, this should be the start of the Joint trajectory point handler internalCB method

bool JointTrajPtHandler::internalCB(industrial::simple_message::SimpleMessage & in)
{
  bool rtn = false;
  JointTrajPtMessage joint_traj_point_msg;

  if (joint_traj_point_msg.init(in))
  {
     .....
  }
  ....
}
edit flag offensive delete link more

Comments

so it was my mistake, sorry

well, this isn't too well documented, so don't feel bad.

I've done this a few times (implementing a driver), so perhaps I can assist you. If you'd like, contact me off-list and I can perhaps point you to a few resources.

gvdhoorn gravatar image gvdhoorn  ( 2017-11-30 04:19:46 -0500 )edit

Thanks a lot for your help! I would happily contact you if I knew how..? I also encountered the same question as here which you have previously answered. how can I contact you?

ManMan88 gravatar image ManMan88  ( 2017-11-30 09:04:28 -0500 )edit

you can find my email address in any commit on my github account.

gvdhoorn gravatar image gvdhoorn  ( 2017-12-01 05:36:44 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-29 08:30:23 -0500

Seen: 137 times

Last updated: Nov 30 '17