jsk-ros-pkg / jsk_roseus

ROS EusLisp Client
http://wiki.ros.org/roseus/Tutorials
17 stars 56 forks source link

add displaying errors to action-result-cb in actionlib.l #669

Closed tkmtnt7000 closed 3 years ago

tkmtnt7000 commented 3 years ago

I added displaying error messages in the topic ...[depending on the robots]../follow_joint_trajectory/result to action-result-cb method. I found it good when I was running KINOVA. This allows us to raise an error on euslisp when the robot does not work due to various reasons, such as joint angle constraints. cc @708yamaguchi

708yamaguchi commented 3 years ago

I am sorry, but my advice was wrong.

The code (send (send msg :result) :error_string)) can only be applied to control_msgs/FollowJointTrajectoryActionResult.

$ rosmsg show control_msgs/FollowJointTrajectoryActionResult
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
actionlib_msgs/GoalStatus status
  uint8 PENDING=0
  uint8 ACTIVE=1
  uint8 PREEMPTED=2
  uint8 SUCCEEDED=3
  uint8 ABORTED=4
  uint8 REJECTED=5
  uint8 PREEMPTING=6
  uint8 RECALLING=7
  uint8 RECALLED=8
  uint8 LOST=9
  actionlib_msgs/GoalID goal_id
    time stamp
    string id
  uint8 status
  string text
control_msgs/FollowJointTrajectoryResult result
  int32 SUCCESSFUL=0
  int32 INVALID_GOAL=-1
  int32 INVALID_JOINTS=-2
  int32 OLD_HEADER_TIMESTAMP=-3
  int32 PATH_TOLERANCE_VIOLATED=-4
  int32 GOAL_TOLERANCE_VIOLATED=-5
  int32 error_code
  string error_string

So you need to submit the pull request to pr2eus/robot-interface.l like this I think (:action-result-cb should be defined in controller-action-client class, which is subclass of ros::simple-action-client

(:action-result-cb (msg)
  (if xx (ros::ros-error yy))
  (send-super :action-result-cb msg))
Affonso-Gui commented 3 years ago

Agree with @708yamaguchi . ros::simple-action-client is the base class which is used for all types of actions, we cannot assume it is only used for FollowJointTrajectory.

Also just to be very clear here you are not raising an error on euslisp, just logging an error message (which is also completely fine).

tkmtnt7000 commented 3 years ago

I see. Thank you for all your advice. I am going to submit a pull request to pr2eus/robot-interface.l

Also just to be very clear here you are not raising an error on euslisp, just logging an error message (which is also completely fine).

Thank you for this, too. Due to my poor English skill, I used the phrase "raising an error on euslisp" by mistake...sorry.