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

Motoman driver with point streaming gets error "Trajectory start position doesn't match current robot position (3011)" #312

Open
harumo11 opened this issue Jan 7, 2020 · 22 comments

Comments

@harumo11
Copy link

harumo11 commented Jan 7, 2020

Hello developers of this great ROS package.

I'd be glad if anyone tell me the solutions.

Summary

I got following error when this my program run.

[ERROR] [1578335995.306456362]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)

Environment

My environment is as follows.

OS : Ubuntu 18.04
ROS Version : Melodic
Robot : SIA20
Controller : FS100
Motoman Package : #215 merged

Details

Now I try to control SIA20 using HTC Vive.
I made pose_follow.cpp and confirmed that I can control SIA20 with HTC Vive controller.

But the program can't move the robot smoothly because MoveIt blocking until the robot trajectory finish completely.
So, as next step, I changed the program in order to move the robot smoothly using point-streaming interface(joint_command topic).
The changed program is pose_follow_fast.cpp.

When the changed program run, I got following error.

roslaunch output with error
robot@robot-NG:~$ roslaunch motoman_sia20d_moveit_config moveit_planning_execution.launch sim:=false controller:=fs100 robot_ip:=10.0.0.2
... logging to /home/robot/.ros/log/52fec8de-3095-11ea-bfa8-309c23cec38a/roslaunch-robot-NG-17312.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
WARNING: disk usage in log directory [/home/robot/.ros/log] is over 1GB.
It's recommended that you use the 'rosclean' command.

started roslaunch server http://robot-NG:36287/

SUMMARY
========

PARAMETERS
 * /controller_joint_names: ['joint_s', 'join...
 * /mongo_wrapper_ros_robot_NG_17312_3303416793777848684/database_path: /home/robot/catki...
 * /mongo_wrapper_ros_robot_NG_17312_3303416793777848684/overwrite: False
 * /move_group/allow_trajectory_execution: True
 * /move_group/allowed_execution_duration_scaling: 1.2
 * /move_group/allowed_goal_duration_margin: 0.5
 * /move_group/capabilities: move_group/MoveGr...
 * /move_group/controller_list: [{'action_ns': 'j...
 * /move_group/jiggle_fraction: 0.05
 * /move_group/manipulator/longest_valid_segment_fraction: 0.05
 * /move_group/manipulator/planner_configs: ['SBLkConfigDefau...
 * /move_group/manipulator/projection_evaluator: joints(joint_s,jo...
 * /move_group/max_range: 5.0
 * /move_group/max_safe_path_cost: 1
 * /move_group/moveit_controller_manager: moveit_simple_con...
 * /move_group/moveit_manage_controllers: True
 * /move_group/octomap_resolution: 0.025
 * /move_group/planner_configs/BKPIECEkConfigDefault/type: geometric::BKPIECE
 * /move_group/planner_configs/ESTkConfigDefault/type: geometric::EST
 * /move_group/planner_configs/KPIECEkConfigDefault/type: geometric::KPIECE
 * /move_group/planner_configs/LBKPIECEkConfigDefault/type: geometric::LBKPIECE
 * /move_group/planner_configs/PRMkConfigDefault/type: geometric::PRM
 * /move_group/planner_configs/PRMstarkConfigDefault/type: geometric::PRMstar
 * /move_group/planner_configs/RRTConnectkConfigDefault/type: geometric::RRTCon...
 * /move_group/planner_configs/RRTkConfigDefault/type: geometric::RRT
 * /move_group/planner_configs/RRTstarkConfigDefault/type: geometric::RRTstar
 * /move_group/planner_configs/SBLkConfigDefault/type: geometric::SBL
 * /move_group/planner_configs/TRRTkConfigDefault/type: geometric::TRRT
 * /move_group/planning_plugin: ompl_interface/OM...
 * /move_group/planning_scene_monitor/publish_geometry_updates: True
 * /move_group/planning_scene_monitor/publish_planning_scene: True
 * /move_group/planning_scene_monitor/publish_state_updates: True
 * /move_group/planning_scene_monitor/publish_transforms_updates: True
 * /move_group/request_adapters: default_planner_r...
 * /move_group/start_state_max_bounds_error: 0.1
 * /robot_description: <?xml version="1....
 * /robot_description_kinematics/manipulator/kinematics_solver: kdl_kinematics_pl...
 * /robot_description_kinematics/manipulator/kinematics_solver_attempts: 10
 * /robot_description_kinematics/manipulator/kinematics_solver_search_resolution: 0.05
 * /robot_description_kinematics/manipulator/kinematics_solver_timeout: 0.01
 * /robot_description_planning/joint_limits/joint_b/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/joint_b/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_b/max_acceleration: 1
 * /robot_description_planning/joint_limits/joint_b/max_velocity: 3.48
 * /robot_description_planning/joint_limits/joint_e/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/joint_e/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_e/max_acceleration: 1
 * /robot_description_planning/joint_limits/joint_e/max_velocity: 2.96
 * /robot_description_planning/joint_limits/joint_l/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/joint_l/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_l/max_acceleration: 1
 * /robot_description_planning/joint_limits/joint_l/max_velocity: 2.26
 * /robot_description_planning/joint_limits/joint_r/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/joint_r/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_r/max_acceleration: 1
 * /robot_description_planning/joint_limits/joint_r/max_velocity: 3.48
 * /robot_description_planning/joint_limits/joint_s/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/joint_s/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_s/max_acceleration: 1
 * /robot_description_planning/joint_limits/joint_s/max_velocity: 2.26
 * /robot_description_planning/joint_limits/joint_t/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/joint_t/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_t/max_acceleration: 1
 * /robot_description_planning/joint_limits/joint_t/max_velocity: 6.97
 * /robot_description_planning/joint_limits/joint_u/has_acceleration_limits: True
 * /robot_description_planning/joint_limits/joint_u/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_u/max_acceleration: 1
 * /robot_description_planning/joint_limits/joint_u/max_velocity: 2.96
 * /robot_description_semantic: <?xml version="1....
 * /robot_ip_address: 10.0.0.2
 * /rosdistro: melodic
 * /rosversion: 1.14.3
 * /rviz_robot_NG_17312_7025465499458344565/manipulator/kinematics_solver: kdl_kinematics_pl...
 * /rviz_robot_NG_17312_7025465499458344565/manipulator/kinematics_solver_attempts: 10
 * /rviz_robot_NG_17312_7025465499458344565/manipulator/kinematics_solver_search_resolution: 0.05
 * /rviz_robot_NG_17312_7025465499458344565/manipulator/kinematics_solver_timeout: 0.01
 * /warehouse_exec: mongod
 * /warehouse_host: localhost
 * /warehouse_port: 33829

NODES
  /
    joint_state (motoman_driver/robot_state_bswap)
    joint_trajectory_action (industrial_robot_client/joint_trajectory_action)
    mongo_wrapper_ros_robot_NG_17312_3303416793777848684 (warehouse_ros/mongo_wrapper_ros.py)
    motion_streaming_interface (motoman_driver/motion_streaming_interface_bswap)
    move_group (moveit_ros_move_group/move_group)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    rviz_robot_NG_17312_7025465499458344565 (rviz/rviz)

ROS_MASTER_URI=http://localhost:11311

process[joint_state-1]: started with pid [17327]
process[motion_streaming_interface-2]: started with pid [17328]
process[joint_trajectory_action-3]: started with pid [17329]
[ERROR] [1578335897.826231495]: Failed to find topic_list parameter
process[robot_state_publisher-4]: started with pid [17335]
[ERROR] [1578335897.831244923]: Failed to find topic_list parameter
process[move_group-5]: started with pid [17341]
process[rviz_robot_NG_17312_7025465499458344565-6]: started with pid [17351]
ERROR: cannot launch node of type [warehouse_ros/mongo_wrapper_ros.py]: can't locate node [mongo_wrapper_ros.py] in package [warehouse_ros]
[ WARN] [1578335897.849943104]: Tried to connect when socket already in connected state
[ INFO] [1578335897.877341623]: Loading robot model 'motoman_sia20d'...
[ WARN] [1578335897.914901865]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/robot_description_kinematics/manipulator/kinematics_solver_attempts' from your configuration.
[ INFO] [1578335897.955209336]: rviz version 1.13.6
[ INFO] [1578335897.955275363]: compiled against Qt version 5.9.5
[ INFO] [1578335897.955288174]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1578335897.958062170]: Forcing OpenGl version 0.
[ INFO] [1578335897.998840449]: Publishing maintained planning scene on 'monitored_planning_scene'
[ INFO] [1578335898.000420115]: MoveGroup debug mode is OFF
Starting planning scene monitors...
[ INFO] [1578335898.000441470]: Starting planning scene monitor
[ INFO] [1578335898.001625214]: Listening to '/planning_scene'
[ INFO] [1578335898.001637900]: Starting world geometry update monitor for collision objects, attached objects, octomap updates.
[ INFO] [1578335898.002604761]: Listening to '/collision_object'
[ INFO] [1578335898.003595758]: Listening to '/planning_scene_world' for planning scene world geometry
[ INFO] [1578335898.020227643]: Listening to '/attached_collision_object' for attached collision objects
Planning scene monitors started.
[ INFO] [1578335898.037231887]: Initializing OMPL interface using ROS parameters
[ INFO] [1578335898.045796709]: Using planning interface 'OMPL'
[ INFO] [1578335898.049300533]: Param 'default_workspace_bounds' was not set. Using default value: 10
[ INFO] [1578335898.049541216]: Param 'start_state_max_bounds_error' was set to 0.1
[ INFO] [1578335898.049783025]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1578335898.050039993]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1578335898.050285108]: Param 'jiggle_fraction' was set to 0.05
[ INFO] [1578335898.050523648]: Param 'max_sampling_attempts' was not set. Using default value: 100
[ INFO] [1578335898.050564889]: Using planning request adapter 'Add Time Parameterization'
[ INFO] [1578335898.050580811]: Using planning request adapter 'Fix Workspace Bounds'
[ INFO] [1578335898.050595364]: Using planning request adapter 'Fix Start State Bounds'
[ INFO] [1578335898.050611277]: Using planning request adapter 'Fix Start State In Collision'
[ INFO] [1578335898.050624599]: Using planning request adapter 'Fix Start State Path Constraints'
[ INFO] [1578335898.286950170]: Added FollowJointTrajectory controller for 
[ INFO] [1578335898.287018558]: Returned 1 controllers in list
[ INFO] [1578335898.292975404]: Trajectory execution is managing controllers
Loading 'move_group/ApplyPlanningSceneService'...
Loading 'move_group/ClearOctomapService'...
Loading 'move_group/MoveGroupCartesianPathService'...
Loading 'move_group/MoveGroupExecuteService'...
[ERROR] [1578335898.303137714]: Exception while loading move_group capability 'move_group/MoveGroupExecuteService': MultiLibraryClassLoader: Could not create object of class type move_group::MoveGroupExecuteService as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
Loading 'move_group/MoveGroupExecuteTrajectoryAction'...
Loading 'move_group/MoveGroupGetPlanningSceneService'...
Loading 'move_group/MoveGroupKinematicsService'...
Loading 'move_group/MoveGroupMoveAction'...
Loading 'move_group/MoveGroupPickPlaceAction'...
Loading 'move_group/MoveGroupPlanService'...
Loading 'move_group/MoveGroupQueryPlannersService'...
Loading 'move_group/MoveGroupStateValidationService'...
[ INFO] [1578335898.322593875]: 

********************************************************
* MoveGroup using: 
*     - ApplyPlanningSceneService
*     - ClearOctomapService
*     - CartesianPathService
*     - ExecuteTrajectoryAction
*     - GetPlanningSceneService
*     - KinematicsService
*     - MoveAction
*     - PickPlaceAction
*     - MotionPlanService
*     - QueryPlannersService
*     - StateValidationService
********************************************************

[ INFO] [1578335898.322625534]: MoveGroup context using planning plugin ompl_interface/OMPLPlanner
[ INFO] [1578335898.322636098]: MoveGroup context initialization complete

You can start planning now!

[ INFO] [1578335898.551265977]: Stereo is NOT SUPPORTED
[ INFO] [1578335898.551314739]: OpenGl version: 4.6 (GLSL 4.6).
[ INFO] [1578335901.906563719]: Loading robot model 'motoman_sia20d'...
[ WARN] [1578335901.933678575]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/rviz_robot_NG_17312_7025465499458344565/manipulator/kinematics_solver_attempts' from your configuration.
[ INFO] [1578335902.028693887]: Starting planning scene monitor
[ INFO] [1578335902.030404256]: Listening to '/move_group/monitored_planning_scene'
[ INFO] [1578335902.045418673]: Constructing new MoveGroup connection for group 'manipulator' in namespace ''
[ INFO] [1578335903.214814867]: Ready to take commands for planning group manipulator.
[ INFO] [1578335903.214914964]: Looking around: no
[ INFO] [1578335903.214987091]: Replanning: no
[ WARN] [1578335958.460593615]: Motoman robot is now enabled and will accept motion commands.
[ WARN] [1578335989.913113992]: Motoman robot is now enabled and will accept motion commands.
[ WARN] [1578335989.913970078]: Motoman robot is now enabled and will accept motion commands.
[ INFO] [1578335989.924496710]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1578335989.925368392]: Planner configuration 'manipulator' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1578335989.925640335]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1578335989.945960335]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1578335989.945986022]: Solution found in 0.020410 seconds
[ INFO] [1578335989.987468276]: SimpleSetup: Path simplification took 0.000580 seconds and changed from 3 to 2 states
[ WARN] [1578335990.192787739]: Motoman robot is now enabled and will accept motion commands.
[ERROR] [1578335990.197748132]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)
[ INFO] [1578335990.199836395]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1578335990.200490228]: Planner configuration 'manipulator' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1578335990.200721133]: RRTConnect: Starting planning with 1 states already in datastructure
[ERROR] [1578335995.206783221]: RRTConnect: Unable to sample any valid states for goal tree
[ INFO] [1578335995.206816981]: RRTConnect: Created 1 states (1 start + 0 goal)
[ INFO] [1578335995.206827763]: No solution found after 5.006186 seconds
[ INFO] [1578335995.212724546]: Unable to solve the planning problem
[ INFO] [1578335995.224689903]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1578335995.224920262]: Planner configuration 'manipulator' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1578335995.225004607]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1578335995.245294835]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1578335995.245321557]: Solution found in 0.020340 seconds
[ INFO] [1578335995.245862537]: SimpleSetup: Path simplification took 0.000524 seconds and changed from 3 to 2 states
[ INFO] [1578335995.249640679]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1578335995.249893007]: Planner configuration 'manipulator' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1578335995.250018804]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1578335995.260239859]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1578335995.260259236]: Solution found in 0.010295 seconds
[ INFO] [1578335995.260980859]: SimpleSetup: Path simplification took 0.000639 seconds and changed from 4 to 2 states
[ERROR] [1578335995.306456362]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)
[ INFO] [1578335995.349684415]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1578335995.349920726]: Planner configuration 'manipulator' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1578335995.350033658]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1578335995.360240904]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1578335995.360259509]: Solution found in 0.010276 seconds
[ INFO] [1578335995.361096808]: SimpleSetup: Path simplification took 0.000821 seconds and changed from 4 to 2 states
[ INFO] [1578335995.449669665]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1578335995.449900292]: Planner configuration 'manipulator' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1578335995.449984647]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1578335995.470237123]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1578335995.470263776]: Solution found in 0.020304 seconds
[ INFO] [1578335995.470917387]: SimpleSetup: Path simplification took 0.000637 seconds and changed from 4 to 2 states
[ INFO] [1578335995.549653770]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1578335995.549876765]: Planner configuration 'manipulator' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1578335995.549962413]: RRTConnect: Starting planning with 1 states already in datastructure
[ERROR] [1578335995.567031724]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)
[ INFO] [1578335995.570235443]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1578335995.570257166]: Solution found in 0.020319 seconds
[ INFO] [1578335995.571031749]: SimpleSetup: Path simplification took 0.000758 seconds and changed from 4 to 2 states
[ERROR] [1578335995.572350036]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)

I don't know what I make mistake and I could not figure out the meaning of the error message "Trajectory start position doesn't match current robot position (3011)" because the robot didn't move absolutely.

I would be glad if you help me.
If you would like to get more information, please feel free to tell me.
Thanks in advance.

@gavanderhoorn
Copy link
Member

You still appear to be using MoveIt to plan trajectories for you. In essence, you are using it to generate very short plans, very rapidly. You then publish those trajectories to the joint_command topic.

There is a very good chance MoveIt isn't completely up-to-date on the current joint states of the robot when you ask it to plan again.

@harumo11
Copy link
Author

harumo11 commented Jan 7, 2020

Thanks for quick response @gavanderhoorn .

Yes, your understanding is right. I'm sorry I didn't explain program flow.
I used MoveIt to solve inverse kinematics.

I added spinOnce() before planning with move_group in pose_follow_fast.cpp at line 143.

But, I'm not sure spinOnce() can modify joint state of move_group.

And then I got same error.

[ERROR] [1578425443.356365813]: Aborting point stream operation.  Failed to send point (#10): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)

Could you tell me appropriate method to modify joint state of move_group?

@harumo11
Copy link
Author

harumo11 commented Jan 7, 2020

I think up-to-date joint state isn't needed for planning because my program just use plan.trajectory_.joint_trajectory.point.back().positions in order to make target joints.

Do you know when the motoman driver need up-to-date joint state.

@EricMarcil
Copy link
Contributor

The error 3011 basically indicates that you are trying to start a new trajectory but your starting point is different than the robot current position. The internal function used in the MotoRos driver is using small increments to move the robot, so it is essential that your trajectory starting point matches the robot current position. The drawback of this is that if you stop a trajectory and try to restart a new one too quickly, the robot current position hasn't had the time to settle and this introduces a small position error that generate the error 3011.

So you either have to keep the current motion alive when you stop by sending the same position over and over. Or you need to give it a few seconds for the last motion to settle and then calculate the new trajectory from a stable current position. The state server update the position every 25 ms.

@gavanderhoorn
Copy link
Member

@EricMarcil: @harumo11 is using #215, which extends the driver with a streaming interface. This allows users to produce JointTrajectoryPoints at a suitable rate, while the driver essentially executes an "infinite" trajectory.

I'm not entirely sure whether the way @harumo11 interfaces with the extended version of the driver is correct.

@harumo11
Copy link
Author

harumo11 commented Jan 7, 2020

Thanks for your great support @gavanderhoorn and @EricMarcil !

As @gavanderhoorn and @EricMarcil said above

The state server update the position every 25 ms.

and

while the driver essentially executes an "infinite" trajectory.

I changed publish rate of joint_command topic from 1Hz to 40Hz and I got same error.
Is this publish rate(40Hz) appropriate?

Before this trial, I made joint_trajectory_publisher.cpp which could send command via joint_command topic. That program just rotates joint_s slowly but the robot moved completely.
I would be glad if this information helps us.

@tanimfresh
Copy link

tanimfresh commented Apr 17, 2020

Hello there @harumo11 and @gavanderhoorn ,

Was there any conclusion or update to this? I am not sure if my implementation is faulty or I am running into a new issue.

OS : Ubuntu 16.04
ROS Version : Kinetic
Robot : GP8
Controller : YRC1000 micro
Motoman Package : #215 merged

I can tell I am entering the point streaming mode, but I don't understand fully how the PR is implemented. From joint_trajectory_streamer.cpp line 184-187 on PR #215 I understand that JointTrajectory msg should not have more than one point. I am able to stream JointTrajectory msg with the current position, but if I update the position at all I receive the following error:

[ERROR] [1587109125.377911108] [/motion_streaming_interface] [ros.motoman_driver]: Aborting point stream operation. Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)

Perhaps I don't fully understand, but how am I supposed to jog/stream points without changing the position? Won't each JointTrajectory msg I stream (containing one JointTrajectoryPoint) not start at the current position?

Below is my client code and at the bottom is the output:

Code:
#!/usr/bin/env python

import sys
import select
import copy
import rospy
import moveit_commander 
import moveit_msgs.msg
import geometry_msgs.msg
from  geometry_msgs.msg import PoseStamped, Pose
from industrial_msgs.msg import RobotStatus
import time
import thread
import math
from std_msgs.msg import String, Header
from moveit_commander.conversions import pose_to_list
import moveit_commander.conversions as conversions
from AngVelScaling import gp8Pose
from trajectory_msgs.msg import JointTrajectory
from trajectory_msgs.msg import JointTrajectoryPoint
from moveit_msgs.msg import RobotState
from sensor_msgs.msg import JointState

class GP8Commander(object):
    def __init__(self):
        super(GP8Commander, self).__init__()
        rospy.init_node('gp8_commander', anonymous=False)

        ## Initialize all move_it related information:
        moveit_commander.roscpp_initialize(sys.argv)
        self.robot = moveit_commander.RobotCommander()
        self.scene = moveit_commander.PlanningSceneInterface()
        group_name = "gp8"
        self.group = moveit_commander.MoveGroupCommander(group_name)
        self.display_trajectory_publisher = rospy.Publisher('/move_group/display_planned_path', moveit_msgs.msg.DisplayTrajectory, queue_size=20)
        self.box_name = ''
        self.planning_frame = self.group.get_planning_frame()
        self.eef_link = self.group.get_end_effector_link()
        self.group_names = self.robot.get_group_names()


def main():      
    #Create main class
    gp8 = GP8Commander()

    #Create publisher for joint_command topic
    pub = rospy.Publisher('/joint_command', JointTrajectory, queue_size= 0)
    
    #Set publish/loop rate
    publish_frequency = 40
    r = rospy.Rate(publish_frequency)

    #Move to start position
    looking = [0,0.6878,0.8525,0,1.42249,0.0]
    gp8.group.go(looking, wait = True)
    
    counter = 0

    #Start setup of traj streaming; create initial point @ current position
    current_joint_values = gp8.group.get_current_joint_values()
    joint_names = gp8.group.get_joints()

    trajectory_msgs = JointTrajectory()
    trajectory_point_msg = JointTrajectoryPoint()

    trajectory_point_msg.positions = current_joint_values
    trajectory_point_msg.velocities = [0,0,0,0,0,0]
    trajectory_point_msg.time_from_start = rospy.Duration(0)

    trajectory_msgs.header.stamp = rospy.Time.now()
    trajectory_msgs.joint_names = joint_names
    trajectory_msgs.points.append(trajectory_point_msg)
    pub.publish(trajectory_msgs)
    print 'Initial target joints were published'

    try:
        while True:
            #Create new trajectory with one point to stream
            counter = counter + 1
            new_trajectory_msgs = JointTrajectory()
            new_trajectory_msgs.joint_names = joint_names
            new_trajectory_msgs.header.stamp = rospy.Time.now()

            new_trajectory_point = JointTrajectoryPoint()
            #Time from start should be loop iteration times 1/frequency
            new_trajectory_point.time_from_start = rospy.Duration((counter)*0.025)
            new_trajectory_point.velocities = [0,0,0,0,0,0]
            new_trajectory_point.positions = gp8.group.get_current_joint_values()
            #Move 'S' joint for incremental motion
            new_trajectory_point.positions[0] += 0.001
            new_trajectory_msgs.points.append(new_trajectory_point)
            pub.publish(new_trajectory_msgs)
            r.sleep()


    except KeyboardInterrupt:
        raise



if __name__ == '__main__':
  try:
    main()
  except rospy.ROSInterruptException:
    pass
Output:
SUMMARY
========

PARAMETERS
 * /controller_joint_names: ['joint_1_s', 'jo...
 * /move_group/allow_trajectory_execution: True
 * /move_group/capabilities: 
 * /move_group/controller_list: [{'action_ns': 'j...
 * /move_group/disable_capabilities: 
 * /move_group/gp8/default_planner_config: None
 * /move_group/gp8/longest_valid_segment_fraction: 0.005
 * /move_group/gp8/planner_configs: ['SBL', 'EST', 'L...
 * /move_group/gp8/projection_evaluator: joints(joint_1_s,...
 * /move_group/gp8_yaw/default_planner_config: 
 * /move_group/gp8_yaw/planner_configs: ['SBL', 'EST', 'L...
 * /move_group/jiggle_fraction: 0.05
 * /move_group/max_range: 5.0
 * /move_group/max_safe_path_cost: 1
 * /move_group/moveit_controller_manager: moveit_simple_con...
 * /move_group/moveit_manage_controllers: True
 * /move_group/octomap_resolution: 0.025
 * /move_group/planner_configs/BFMT/balanced: 0
 * /move_group/planner_configs/BFMT/cache_cc: 1
 * /move_group/planner_configs/BFMT/extended_fmt: 1
 * /move_group/planner_configs/BFMT/heuristics: 1
 * /move_group/planner_configs/BFMT/nearest_k: 1
 * /move_group/planner_configs/BFMT/num_samples: 1000
 * /move_group/planner_configs/BFMT/optimality: 1
 * /move_group/planner_configs/BFMT/radius_multiplier: 1.0
 * /move_group/planner_configs/BFMT/type: geometric::BFMT
 * /move_group/planner_configs/BKPIECE/border_fraction: 0.9
 * /move_group/planner_configs/BKPIECE/failed_expansion_score_factor: 0.5
 * /move_group/planner_configs/BKPIECE/min_valid_path_fraction: 0.5
 * /move_group/planner_configs/BKPIECE/range: 0.0
 * /move_group/planner_configs/BKPIECE/type: geometric::BKPIECE
 * /move_group/planner_configs/BiEST/range: 0.0
 * /move_group/planner_configs/BiEST/type: geometric::BiEST
 * /move_group/planner_configs/BiTRRT/cost_threshold: 1e300
 * /move_group/planner_configs/BiTRRT/frountier_node_ratio: 0.1
 * /move_group/planner_configs/BiTRRT/frountier_threshold: 0.0
 * /move_group/planner_configs/BiTRRT/init_temperature: 100
 * /move_group/planner_configs/BiTRRT/range: 0.0
 * /move_group/planner_configs/BiTRRT/temp_change_factor: 0.1
 * /move_group/planner_configs/BiTRRT/type: geometric::BiTRRT
 * /move_group/planner_configs/EST/goal_bias: 0.05
 * /move_group/planner_configs/EST/range: 0.0
 * /move_group/planner_configs/EST/type: geometric::EST
 * /move_group/planner_configs/FMT/cache_cc: 1
 * /move_group/planner_configs/FMT/extended_fmt: 1
 * /move_group/planner_configs/FMT/heuristics: 0
 * /move_group/planner_configs/FMT/nearest_k: 1
 * /move_group/planner_configs/FMT/num_samples: 1000
 * /move_group/planner_configs/FMT/radius_multiplier: 1.1
 * /move_group/planner_configs/FMT/type: geometric::FMT
 * /move_group/planner_configs/KPIECE/border_fraction: 0.9
 * /move_group/planner_configs/KPIECE/failed_expansion_score_factor: 0.5
 * /move_group/planner_configs/KPIECE/goal_bias: 0.05
 * /move_group/planner_configs/KPIECE/min_valid_path_fraction: 0.5
 * /move_group/planner_configs/KPIECE/range: 0.0
 * /move_group/planner_configs/KPIECE/type: geometric::KPIECE
 * /move_group/planner_configs/LBKPIECE/border_fraction: 0.9
 * /move_group/planner_configs/LBKPIECE/min_valid_path_fraction: 0.5
 * /move_group/planner_configs/LBKPIECE/range: 0.0
 * /move_group/planner_configs/LBKPIECE/type: geometric::LBKPIECE
 * /move_group/planner_configs/LBTRRT/epsilon: 0.4
 * /move_group/planner_configs/LBTRRT/goal_bias: 0.05
 * /move_group/planner_configs/LBTRRT/range: 0.0
 * /move_group/planner_configs/LBTRRT/type: geometric::LBTRRT
 * /move_group/planner_configs/LazyPRM/range: 0.0
 * /move_group/planner_configs/LazyPRM/type: geometric::LazyPRM
 * /move_group/planner_configs/LazyPRMstar/type: geometric::LazyPR...
 * /move_group/planner_configs/PDST/type: geometric::PDST
 * /move_group/planner_configs/PRM/max_nearest_neighbors: 10
 * /move_group/planner_configs/PRM/type: geometric::PRM
 * /move_group/planner_configs/PRMstar/type: geometric::PRMstar
 * /move_group/planner_configs/ProjEST/goal_bias: 0.05
 * /move_group/planner_configs/ProjEST/range: 0.0
 * /move_group/planner_configs/ProjEST/type: geometric::ProjEST
 * /move_group/planner_configs/RRT/goal_bias: 0.05
 * /move_group/planner_configs/RRT/range: 0.0
 * /move_group/planner_configs/RRT/type: geometric::RRT
 * /move_group/planner_configs/RRTConnect/range: 0.0
 * /move_group/planner_configs/RRTConnect/type: geometric::RRTCon...
 * /move_group/planner_configs/RRTstar/delay_collision_checking: 1
 * /move_group/planner_configs/RRTstar/goal_bias: 0.05
 * /move_group/planner_configs/RRTstar/range: 0.0
 * /move_group/planner_configs/RRTstar/type: geometric::RRTstar
 * /move_group/planner_configs/SBL/range: 0.0
 * /move_group/planner_configs/SBL/type: geometric::SBL
 * /move_group/planner_configs/SPARS/dense_delta_fraction: 0.001
 * /move_group/planner_configs/SPARS/max_failures: 1000
 * /move_group/planner_configs/SPARS/sparse_delta_fraction: 0.25
 * /move_group/planner_configs/SPARS/stretch_factor: 3.0
 * /move_group/planner_configs/SPARS/type: geometric::SPARS
 * /move_group/planner_configs/SPARStwo/dense_delta_fraction: 0.001
 * /move_group/planner_configs/SPARStwo/max_failures: 5000
 * /move_group/planner_configs/SPARStwo/sparse_delta_fraction: 0.25
 * /move_group/planner_configs/SPARStwo/stretch_factor: 3.0
 * /move_group/planner_configs/SPARStwo/type: geometric::SPARStwo
 * /move_group/planner_configs/STRIDE/degree: 16
 * /move_group/planner_configs/STRIDE/estimated_dimension: 0.0
 * /move_group/planner_configs/STRIDE/goal_bias: 0.05
 * /move_group/planner_configs/STRIDE/max_degree: 18
 * /move_group/planner_configs/STRIDE/max_pts_per_leaf: 6
 * /move_group/planner_configs/STRIDE/min_degree: 12
 * /move_group/planner_configs/STRIDE/min_valid_path_fraction: 0.2
 * /move_group/planner_configs/STRIDE/range: 0.0
 * /move_group/planner_configs/STRIDE/type: geometric::STRIDE
 * /move_group/planner_configs/STRIDE/use_projected_distance: 0
 * /move_group/planner_configs/TRRT/frountierNodeRatio: 0.1
 * /move_group/planner_configs/TRRT/frountier_threshold: 0.0
 * /move_group/planner_configs/TRRT/goal_bias: 0.05
 * /move_group/planner_configs/TRRT/init_temperature: 10e-6
 * /move_group/planner_configs/TRRT/k_constant: 0.0
 * /move_group/planner_configs/TRRT/max_states_failed: 10
 * /move_group/planner_configs/TRRT/min_temperature: 10e-10
 * /move_group/planner_configs/TRRT/range: 0.0
 * /move_group/planner_configs/TRRT/temp_change_factor: 2.0
 * /move_group/planner_configs/TRRT/type: geometric::TRRT
 * /move_group/planning_plugin: ompl_interface/OM...
 * /move_group/planning_scene_monitor/publish_geometry_updates: True
 * /move_group/planning_scene_monitor/publish_planning_scene: True
 * /move_group/planning_scene_monitor/publish_state_updates: True
 * /move_group/planning_scene_monitor/publish_transforms_updates: True
 * /move_group/request_adapters: default_planner_r...
 * /move_group/sensors: [{'point_subsampl...
 * /move_group/start_state_max_bounds_error: 0.1
 * /move_group/trajectory_execution/allowed_execution_duration_scaling: 1.2
 * /move_group/trajectory_execution/allowed_goal_duration_margin: 0.5
 * /move_group/trajectory_execution/allowed_start_tolerance: 0.01
 * /robot_description: <?xml version="1....
 * /robot_description_kinematics/gp8/kinematics_solver: kdl_kinematics_pl...
 * /robot_description_kinematics/gp8/kinematics_solver_attempts: 3
 * /robot_description_kinematics/gp8/kinematics_solver_search_resolution: 0.005
 * /robot_description_kinematics/gp8/kinematics_solver_timeout: 0.005
 * /robot_description_planning/joint_limits/joint_1_s/has_acceleration_limits: False
 * /robot_description_planning/joint_limits/joint_1_s/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_1_s/max_acceleration: 0
 * /robot_description_planning/joint_limits/joint_1_s/max_velocity: 7.9412
 * /robot_description_planning/joint_limits/joint_2_l/has_acceleration_limits: False
 * /robot_description_planning/joint_limits/joint_2_l/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_2_l/max_acceleration: 0
 * /robot_description_planning/joint_limits/joint_2_l/max_velocity: 6.7495
 * /robot_description_planning/joint_limits/joint_3_u/has_acceleration_limits: False
 * /robot_description_planning/joint_limits/joint_3_u/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_3_u/max_acceleration: 0
 * /robot_description_planning/joint_limits/joint_3_u/max_velocity: 9.0757
 * /robot_description_planning/joint_limits/joint_4_r/has_acceleration_limits: False
 * /robot_description_planning/joint_limits/joint_4_r/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_4_r/max_acceleration: 0
 * /robot_description_planning/joint_limits/joint_4_r/max_velocity: 9.5993
 * /robot_description_planning/joint_limits/joint_5_b/has_acceleration_limits: False
 * /robot_description_planning/joint_limits/joint_5_b/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_5_b/max_acceleration: 0
 * /robot_description_planning/joint_limits/joint_5_b/max_velocity: 9.5993
 * /robot_description_planning/joint_limits/joint_6_t/has_acceleration_limits: False
 * /robot_description_planning/joint_limits/joint_6_t/has_velocity_limits: True
 * /robot_description_planning/joint_limits/joint_6_t/max_acceleration: 0
 * /robot_description_planning/joint_limits/joint_6_t/max_velocity: 17.4845
 * /robot_description_semantic: <?xml version="1....
 * /robot_ip_address: 192.168.1.31
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /rviz_tanim_ThinkPad_P52s_27931_1761526624882218183/gp8/kinematics_solver: kdl_kinematics_pl...
 * /rviz_tanim_ThinkPad_P52s_27931_1761526624882218183/gp8/kinematics_solver_attempts: 3
 * /rviz_tanim_ThinkPad_P52s_27931_1761526624882218183/gp8/kinematics_solver_search_resolution: 0.005
 * /rviz_tanim_ThinkPad_P52s_27931_1761526624882218183/gp8/kinematics_solver_timeout: 0.005

NODES
  /
    joint_state (motoman_driver/robot_state)
    joint_trajectory_action (industrial_robot_client/joint_trajectory_action)
    motion_streaming_interface (motoman_driver/motion_streaming_interface)
    move_group (moveit_ros_move_group/move_group)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    rviz_tanim_ThinkPad_P52s_27931_1761526624882218183 (rviz/rviz)

auto-starting new master
process[master]: started with pid [27941]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to fc3e2e8a-8081-11ea-b57c-482ae3092af3
process[rosout-1]: started with pid [27954]
started core service [/rosout]
process[joint_state-2]: started with pid [27972]
process[motion_streaming_interface-3]: started with pid [27973]
process[joint_trajectory_action-4]: started with pid [27974]
[ERROR] [1587110636.626089121] [/joint_state] [ros.motoman_driver]: Failed to find topic_list parameter
process[robot_state_publisher-5]: started with pid [27994]
[ERROR] [1587110636.636597188] [/motion_streaming_interface] [ros.motoman_driver]: Failed to find topic_list parameter
process[move_group-6]: started with pid [28021]
process[rviz_tanim_ThinkPad_P52s_27931_1761526624882218183-7]: started with pid [28057]
[ WARN] [1587110636.700912328] [/move_group] [ros.rosconsole_bridge.console_bridge]: Link 'platform' is not known to URDF. Cannot disable collisons.
[ WARN] [1587110636.700977031] [/move_group] [ros.rosconsole_bridge.console_bridge]: Link 'platform' is not known to URDF. Cannot disable collisons.
[ INFO] [1587110636.701052290] [/move_group] [ros.moveit_core.robot_model]: Loading robot model 'motoman_gp8'...
[ INFO] [1587110636.772196268] [${node}] [ros.rviz]: rviz version 1.12.17
[ INFO] [1587110636.772379005] [${node}] [ros.rviz]: compiled against Qt version 5.5.1
[ INFO] [1587110636.772416399] [${node}] [ros.rviz]: compiled against OGRE version 1.9.0 (Ghadamon)
[ WARN] [1587110636.777336624] [/move_group] [ros.rosconsole_bridge.console_bridge]: Link 'platform' is not known to URDF. Cannot disable collisons.
[ WARN] [1587110636.777374472] [/move_group] [ros.rosconsole_bridge.console_bridge]: Link 'platform' is not known to URDF. Cannot disable collisons.
[ INFO] [1587110636.777423869] [/move_group] [ros.moveit_core.robot_model]: Loading robot model 'motoman_gp8'...
[ WARN] [1587110636.802435264] [/move_group] [ros.kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[ INFO] [1587110636.911603795] [/move_group] [ros.moveit_ros_planning.planning_scene_monitor]: Publishing maintained planning scene on 'monitored_planning_scene'
[ INFO] [1587110636.914366148] [/move_group] [ros.moveit_ros_move_group]: MoveGroup debug mode is OFF
Starting context monitors...
[ INFO] [1587110636.914433795] [/move_group] [ros.moveit_ros_planning.planning_scene_monitor]: Starting scene monitor
[ INFO] [1587110636.916575032] [/move_group] [ros.moveit_ros_planning.planning_scene_monitor]: Listening to '/planning_scene'
[ INFO] [1587110636.916602704] [/move_group] [ros.moveit_ros_planning.planning_scene_monitor]: Starting world geometry monitor
[ INFO] [1587110636.918722485] [/move_group] [ros.moveit_ros_planning.planning_scene_monitor]: Listening to '/collision_object' using message notifier with target frame '/base_link '
[ INFO] [1587110636.923823468] [/move_group] [ros.moveit_ros_planning.planning_scene_monitor]: Listening to '/planning_scene_world' for planning scene world geometry
[ INFO] [1587110637.052566733] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.rviz]: Stereo is NOT SUPPORTED
[ INFO] [1587110637.052687524] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.rviz]: OpenGl version: 3 (GLSL 1.3).
[ INFO] [1587110637.377592565] [/move_group] [ros.moveit_ros_perception]: Listening to '/head_mount_kinect/depth_registered/points' using message filter with target frame '/base_link '
[ INFO] [1587110637.384776196] [/move_group] [ros.moveit_ros_planning.planning_scene_monitor]: Listening to '/attached_collision_object' for attached collision objects
Context monitors started.
[ INFO] [1587110637.414732230] [/move_group] [ros.moveit_planners_ompl]: Initializing OMPL interface using ROS parameters
[ERROR] [1587110637.421139116] [/move_group] [ros.moveit_planners_ompl]: Could not find the planner configuration 'None' on the param server
[ INFO] [1587110637.452749655] [/move_group] [ros.moveit_ros_planning]: Using planning interface 'OMPL'
[ INFO] [1587110637.458709459] [/move_group] [ros.moveit_ros_planning]: Param 'default_workspace_bounds' was not set. Using default value: 10
[ INFO] [1587110637.459930329] [/move_group] [ros.moveit_ros_planning]: Param 'start_state_max_bounds_error' was set to 0.1
[ INFO] [1587110637.460704404] [/move_group] [ros.moveit_ros_planning]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1587110637.461542171] [/move_group] [ros.moveit_ros_planning]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1587110637.462342027] [/move_group] [ros.moveit_ros_planning]: Param 'jiggle_fraction' was set to 0.05
[ INFO] [1587110637.463081063] [/move_group] [ros.moveit_ros_planning]: Param 'max_sampling_attempts' was not set. Using default value: 100
[ INFO] [1587110637.463193285] [/move_group] [ros.moveit_ros_planning]: Using planning request adapter 'Add Time Parameterization'
[ INFO] [1587110637.463233926] [/move_group] [ros.moveit_ros_planning]: Using planning request adapter 'Fix Workspace Bounds'
[ INFO] [1587110637.463275481] [/move_group] [ros.moveit_ros_planning]: Using planning request adapter 'Fix Start State Bounds'
[ INFO] [1587110637.463304426] [/move_group] [ros.moveit_ros_planning]: Using planning request adapter 'Fix Start State In Collision'
[ INFO] [1587110637.463328305] [/move_group] [ros.moveit_ros_planning]: Using planning request adapter 'Fix Start State Path Constraints'
[ INFO] [1587110637.625098071] [/move_group] [ros.moveit_simple_controller_manager.manager]: Added FollowJointTrajectory controller for 
[ INFO] [1587110637.625219352] [/move_group] [ros.moveit_simple_controller_manager.manager]: Returned 1 controllers in list
[ INFO] [1587110637.641118933] [/move_group] [ros.moveit_ros_planning.trajectory_execution_manager]: Trajectory execution is managing controllers
Loading 'move_group/ApplyPlanningSceneService'...
Loading 'move_group/ClearOctomapService'...
Loading 'move_group/MoveGroupCartesianPathService'...
Loading 'move_group/MoveGroupExecuteTrajectoryAction'...
Loading 'move_group/MoveGroupGetPlanningSceneService'...
Loading 'move_group/MoveGroupKinematicsService'...
Loading 'move_group/MoveGroupMoveAction'...
Loading 'move_group/MoveGroupPickPlaceAction'...
Loading 'move_group/MoveGroupPlanService'...
Loading 'move_group/MoveGroupQueryPlannersService'...
Loading 'move_group/MoveGroupStateValidationService'...
[ INFO] [1587110637.724777206] [/move_group] [ros.moveit_ros_move_group]: 

********************************************************
* MoveGroup using: 
*     - ApplyPlanningSceneService
*     - ClearOctomapService
*     - CartesianPathService
*     - ExecuteTrajectoryAction
*     - GetPlanningSceneService
*     - KinematicsService
*     - MoveAction
*     - PickPlaceAction
*     - MotionPlanService
*     - QueryPlannersService
*     - StateValidationService
********************************************************

[ INFO] [1587110637.724882630] [/move_group] [ros.moveit_ros_move_group]: MoveGroup context using planning plugin ompl_interface/OMPLPlanner
[ INFO] [1587110637.724916069] [/move_group] [ros.moveit_ros_move_group]: MoveGroup context initialization complete

You can start planning now!

[ WARN] [1587110640.528812915] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.rosconsole_bridge.console_bridge]: Link 'platform' is not known to URDF. Cannot disable collisons.
[ WARN] [1587110640.528873909] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.rosconsole_bridge.console_bridge]: Link 'platform' is not known to URDF. Cannot disable collisons.
[ INFO] [1587110640.529073993] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.moveit_core.robot_model]: Loading robot model 'motoman_gp8'...
[ WARN] [1587110640.604589911] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.rosconsole_bridge.console_bridge]: Link 'platform' is not known to URDF. Cannot disable collisons.
[ WARN] [1587110640.604648225] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.rosconsole_bridge.console_bridge]: Link 'platform' is not known to URDF. Cannot disable collisons.
[ INFO] [1587110640.604713074] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.moveit_core.robot_model]: Loading robot model 'motoman_gp8'...
[ WARN] [1587110640.629036978] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[ INFO] [1587110640.747135196] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.moveit_ros_planning.planning_scene_monitor]: Starting scene monitor
[ INFO] [1587110640.752504703] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.moveit_ros_planning.planning_scene_monitor]: Listening to '/move_group/monitored_planning_scene'
[ WARN] [1587110640.981682175] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[ INFO] [1587110640.986159537] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.moveit_ros_visualization]: Constructing new MoveGroup connection for group 'gp8' in namespace ''
[ INFO] [1587110642.157768100] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.moveit_ros_planning_interface.move_group_interface]: Ready to take commands for planning group gp8.
[ INFO] [1587110642.157884878] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.moveit_ros_planning_interface.move_group_interface]: Looking around: no
[ INFO] [1587110642.157967237] [/rviz_tanim_ThinkPad_P52s_27931_1761526624882218183] [ros.moveit_ros_planning_interface.move_group_interface]: Replanning: no
[ INFO] [1587110682.977035883] [/move_group] [ros.moveit_ros_move_group]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline.
[ INFO] [1587110682.977419671] [/move_group] [ros.moveit_ros_move_group]: Goal constraints are already satisfied. No need to plan or execute any motions
[ERROR] [1587110684.730385865] [/motion_streaming_interface] [ros.motoman_driver]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)
[ERROR] [1587110684.795248859] [/motion_streaming_interface] [ros.motoman_driver]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)
[ERROR] [1587110684.853174099] [/motion_streaming_interface] [ros.motoman_driver]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)
[ERROR] [1587110685.167882359] [/motion_streaming_interface] [ros.motoman_driver]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)
[ERROR] [1587110685.486087713] [/motion_streaming_interface] [ros.motoman_driver]: Aborting point stream operation.  Failed to send point (#0): Invalid message (3) : Trajectory start position doesn't match current robot position (3011)

@harumo11
Copy link
Author

Hello @tanimfresh
I yet solve this problem completely.
But I found the temporary solution.

Please try to send initial message which has zero velocity command time and again with 40Hz.

I'm glad if this solution helps you.

@tanimfresh
Copy link

@harumo11 When you say again, do you mean I should send this point twice? Similar to your joint_trajectory.cpp, I send it once outside of a loop (with time0 and position0), and then I enter into a for loop where I increment the time from start and position (time from start increases by 1/40 seconds and position I increase one joint position by 0.01; time_n and position_n). Do you mean to say once I enter into the loop I should again send the initial point (time0 and position0) once again before getting into time_n and position_n?

@MarqRazz

This comment has been minimized.

@MarqRazz

This comment has been minimized.

@ted-miller

This comment has been minimized.

@MarqRazz

This comment has been minimized.

@gavanderhoorn

This comment has been minimized.

@gavanderhoorn

This comment has been minimized.

@EricMarcil

This comment has been minimized.

@ted-miller

This comment has been minimized.

@MarqRazz

This comment has been minimized.

@tdl-ua
Copy link
Contributor

tdl-ua commented Apr 22, 2020

Hi all,

In response to @harumo11 and @tanimfresh, I just wanted to provide a usage example for PR #215: https://github.com/tbs-ualberta/manipulator_pose_following/blob/dev/src/pose_following_node.cpp

This code basically implements teleoperation using point streaming on a 7-axis manipulator (have never gotten around to making it more HW-agnostic). It obtains the current joint angles, than adds small increments to those angles and sends the updated joint angles to the controller. I think the key word here is small because I have a suspicion (never confirmed) that the streaming server on the controller does not accept joint angle increments that are too large. The position mismatch error still occurred occasionally for me as well but pretty sporadically if I remember correctly (it's been a while).

This code also contains the IK computation via the Jacobian, which is obtained from MoveIt. It was always fast enough at a sampling rate of 40Hz. Having said that, there are better ways of obtaining desired joint angles (see here for example).

Hope this helps a little.

PS @MarqRazz I don't think merging #215 will help you. I might have some suggestions for your particular problem but would provide those in the appropriate issue.

@MarqRazz

This comment has been minimized.

@gavanderhoorn
Copy link
Member

Sorry @tanimfresh and @harumo11 for dirtying up your issue thread! I would be happy to remove my comments from here if you would like me to clean it up.

This is not necessary. I'll hide them as off-topic.

There is still value in keeping them here.

@harumo11
Copy link
Author

harumo11 commented May 1, 2020

@tanimfresh As I mentioned, we have to send message with zero velocity before robot moves time and again. Simply put, our program structure should be as bellow.

    publish_frequency = 40
    r = rospy.Rate(publish_frequency)

    trajectory_msgs = JointTrajectory()
    trajectory_point_msg = JointTrajectoryPoint()

    trajectory_point_msg.positions = current_joint_values
    trajectory_point_msg.velocities = [0,0,0,0,0,0]
    trajectory_point_msg.time_from_start = rospy.Duration(0)

    trajectory_msgs.header.stamp = rospy.Time.now()
    trajectory_msgs.joint_names = joint_names
    trajectory_msgs.points.append(trajectory_point_msg)
   
    for i in range(10)
        pub.publish(trajectory_msgs)
        r.sleep()
        print 'Initial target joints were published'

    try:
        while True:
            #Here is a main loop. motor positions are increased

But sorry. This is not fundamental solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants