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

Rick C NIST's profile - activity

2016-03-10 08:59:24 -0500 commented answer JointTrajectory time_from_start resets to all zeros after publish()

Hi Benjamin, Yes, I was using the plugin that you mentioned.

2015-08-04 19:03:39 -0500 received badge  Famous Question (source)
2014-10-30 12:35:41 -0500 received badge  Notable Question (source)
2014-10-30 12:35:41 -0500 received badge  Popular Question (source)
2014-08-11 07:07:18 -0500 received badge  Famous Question (source)
2014-07-25 15:30:39 -0500 received badge  Famous Question (source)
2014-07-19 08:35:53 -0500 received badge  Notable Question (source)
2014-07-19 08:35:53 -0500 received badge  Popular Question (source)
2014-07-18 19:01:05 -0500 received badge  Notable Question (source)
2014-07-18 19:01:05 -0500 received badge  Popular Question (source)
2014-07-14 02:39:11 -0500 received badge  Notable Question (source)
2014-06-28 20:38:09 -0500 received badge  Famous Question (source)
2014-06-27 21:10:54 -0500 received badge  Popular Question (source)
2014-06-27 21:10:45 -0500 received badge  Student (source)
2014-06-27 14:36:50 -0500 commented answer MoveIt! compute_cartesian_path() does not compute correct joint trajectory

Joints at all 0 means the home position (i.e. all scrunched up) Here is a picture of the home position: http://www.kuka-labs.com/NR/rdonlyres/17026737-5839-4346-9939-5D012133E9FE/0/service_youBot_Features.jpg. I would have thought that get_random_pose() would give me a valid pose.

2014-06-27 11:45:37 -0500 commented question MoveIt! compute_cartesian_path() does not compute correct joint trajectory

I am using the Kuka youbot URDF unmodified which I am assuming is correct. The setup assistant could be the problem or maybe that I am not setting the end effector link? One interesting data point is that if I call group.set_pose_target(pose) and then group.plan(), I get a valid trajectory from Moveit.

2014-06-27 10:14:03 -0500 received badge  Scholar (source)
2014-06-27 08:42:41 -0500 asked a question MoveIt! compute_cartesian_path() does not compute correct joint trajectory

Hello, I am using ROS Hydro on Ubuntu 12.04. When calling MoveIt! Commander's (Python) move_group.compute_cartesian_path() method, the return value is always the current joint configuration. The code looks something like this.

eef_link = "gripper_palm_link"
waypoints = []
waypoints = group.get_random_pose(eef_link)
poses.append(copy.deepcopy(pose.pose))
waypoints = group.get_random_pose(eef_link)
poses.append(copy.deepcopy(pose.pose))
(plan, fraction) = group.compute_cartesian_path(waypoints, eef_step=0.01, jump_threshold=0.0, avoid_collisions=True)

My robot starts off in the home position which is essentially joint positions set to all zeros. After the call to compute_cartesian_path() the resultant joint trajectory look like this:

header: 
  seq: 20
  stamp: 
    secs: 0
    nsecs: 0
  frame_id: base_link
joint_names: ['arm_joint_1', 'arm_joint_2', 'arm_joint_3', 'arm_joint_4', 'arm_joint_5']
points: 
  - 
    positions: [0.001216606411158061, 0.0001137616260065144, -0.0006536926007463251, 0.0025598054398985326, 0.0007543179427678126]
    velocities: [0.0, 0.0, 0.0, 0.0, 0.0]
    accelerations: [0.0, 0.0, 0.0, 0.0, 0.0]
    effort: []
    time_from_start: 
      secs: 2
      nsecs: 0

The positions are essentially zero (i.e., the home position). I suspect that the call to group.get_random_pose(eef_link) is returning an invalid end effector position, but I don't know why it would do that. Any help would be appreciated.

2014-06-27 08:22:31 -0500 commented answer JointTrajectory time_from_start resets to all zeros after publish()

Thank you. That was what I was looking for. I will use the rospy.Duration method from now on.

2014-06-27 08:22:04 -0500 answered a question JointTrajectory time_from_start resets to all zeros after publish()

Thank you. That was what I was looking for. I will use the rospy.Duration method from now on.

2014-06-26 17:37:56 -0500 asked a question JointTrajectory time_from_start resets to all zeros after publish()

Ubuntu 12.04 ROS Hydro

I am publishing a JointTrajectory to Gazebo and monitoring the topic using rostopic echo. The data that I publish is different from what gets captured by rostopic echo. Somehow the "time_from_start" portion of the data gets zeroed out.

A snippet of my code is as follows

  # this is where I create and populate the JointTrajectory
  jt = make_trajectory_msg(plan=plan, secs=0.5, dt=0.2, frame_id='base_link' )
  rospy.loginfo("Publishing joint trajectory")
  while not rospy.is_shutdown():
    print jt
    gazebo_command_publisher.publish(jt)
    r.sleep()

As you can see, right before I call publish() I print the trajectory. Here is what the trajectory looks like before the publish()

header: 
  seq: 5
  stamp: 
    secs: 0
    nsecs: 0
  frame_id: base_link
joint_names: ['arm_joint_1', 'arm_joint_2', 'arm_joint_3', 'arm_joint_4', 'arm_joint_5']
points: 
  - 
    positions: [0.2792831707677692, 0.4627657000396006, -0.8622084888670658, 0.8533643604717218, 0.1568816032950613]
    velocities: [0.0, 0.0, 0.0, 0.0, 0.0]
    accelerations: [0.0, 0.0, 0.0, 0.0, 0.0]
    effort: []
    time_from_start: 
      secs: 0.7
      nsecs: 0

And here is the trajectory after it is captured by rostopic echo:

header: 
  seq: 5
  stamp: 
    secs: 0
    nsecs: 0
  frame_id: base_link
joint_names: ['arm_joint_1', 'arm_joint_2', 'arm_joint_3', 'arm_joint_4', 'arm_joint_5']
points: 
  - 
    positions: [0.2792831707677692, 0.4627657000396006, -0.8622084888670658, 0.8533643604717218, 0.1568816032950613]
    velocities: [0.0, 0.0, 0.0, 0.0, 0.0]
    accelerations: [0.0, 0.0, 0.0, 0.0, 0.0]
    effort: []
    time_from_start: 
      secs: 0
      nsecs: 0
2014-06-26 17:23:25 -0500 received badge  Enthusiast
2014-06-25 12:08:22 -0500 answered a question Moveit Python Demo causes [Errno 9] Bad file descriptor

I reran the moveit setup assistant, and this problem went away. Must have been an error in one of my configuration files

2014-06-25 12:07:57 -0500 commented question Moveit Python Demo causes [Errno 9] Bad file descriptor

I reran the moveit setup assistant, and this problem went away. Must have been an error in one of my configuration files

2014-06-25 09:49:55 -0500 asked a question MoveIt! commander with youbot

Hello MoveIt! Commander enthusiasts. We are having problems getting our youbot to move properly in simulation with gazebo. Our architecture is as follows:

MoveIt Commander ==> python_script ==> gazebo (headless) ==> rviz

We use Moveit Commander to select a named pose stored in the SRDF and then compute a plan. We then publish that plan to the youbot topic called "/arm_1/arm_controller/command". This topic works great with sending messages using the rostopic pub command with all joint positions set to valid values and velocity, acceleration, and effort set to zero. We can publish a JointTrajectory (JT) message with a single JointTrajectoryPoint (JTP) at 10 Hz and the robot moves just fine in gazebo.

When publishing from our Python script, the velocity, acceleration, and efforts are all populated. We publish a valid JT with more than one JTP computed by the MoveIt Commander plan() function at the same rate, and the robot does not move 1) unless we publish at least 3 times, and 2) as the robot moves, it appears to jerk to and from the starting position. Presumably this is because I have published the JT command three times and the LIFO design of ROS subscriber/publisher queuing causes the robot to get confused until the final JT command is received by gazebo.

Our python code is as follows. I apologize ahead of time for the look of our code, but we are just prototyping as this stage.

#!/usr/bin/env python

import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint 

from std_msgs.msg import String

def get_random_waypoints(move_group=[], n=2):
    ''' Get a series of waypoints with the current pose first'''
    geom_points = []
    pose = move_group.get_current_pose().pose
    geom_points.append(copy.deepcopy(pose))
    try:
        for ii in range(0,n):
            pose = move_group.get_random_pose().pose
            geom_points.append(copy.deepcopy(pose))
        return copy.deepcopy(geom_points)    
    except MoveItCommanderException:
        print "get_random_waypoints failed"
        return False


def make_trajectory_msg(joint_trajectory_plan=[], seq=0, secs=0, nsecs=0, dt=2, frame_id='/base_link'):
    jt = JointTrajectory()
    jt.header.seq = seq
    jt.header.stamp.secs = 0 #secs
    jt.header.stamp.nsecs = 0 #nsecs
    jt.header.frame_id = frame_id
    jt.joint_names = joint_trajectory_plan.joint_trajectory.joint_names
    njtp = len(joint_trajectory_plan.joint_trajectory.points)
    for ii in range(0, njtp):
        jtp = JointTrajectoryPoint()
        jtp = copy.deepcopy(joint_trajectory_plan.joint_trajectory.points[ii])
        jtp.time_from_start.secs = secs + dt*(ii+1)
        jtp.time_from_start.nsecs = nsecs
        jt.points.append(jtp)
    return jt

def move_robot():

  print "============ Starting tutorial setup"
  moveit_commander.roscpp_initialize(sys.argv)
  rospy.init_node('my_moveit_client',
                  anonymous=False)

  ## Instantiate a RobotCommander object. This object is an interface to
  ## the robot as a whole. 
  robot = moveit_commander.RobotCommander()

  ## Instantiate a PlanningSceneInterface object. This object is an interface
  ## to the world surrounding the robot.
  scene = moveit_commander.PlanningSceneInterface()

  ## Instantiate a MoveGroupCommander object. This object is an interface
  ## to one group of joints. In this case the group is the joints in the left
  ## arm. This interface can be used to plan and execute motions on the left
  ## arm.
  print "Creating move group commander object"
  group = moveit_commander.MoveGroupCommander("manipulator")

  ## We create this DisplayTrajectory ...
(more)
2014-06-20 00:17:07 -0500 received badge  Popular Question (source)
2014-06-20 00:17:07 -0500 received badge  Notable Question (source)
2014-06-16 14:27:47 -0500 asked a question Segmentation fault on call to moveit_commander.RobotCommander()

OS: Ubuntu 12.04 ROS and ROS packages installed with apt-get

My code

#!/usr/bin/python

import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg

print("============ Starting tutorial setup")
moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node('my_youbot_moveit', anonymous=True)
robot = moveit_commander.RobotCommander()

My output

[rick@rick-hydro:~/catkin_ws] rosrun moveit_my_youbot moveit_my_youbot.py
============ Starting tutorial setup
Segmentation fault (core dumped)

Checking dependencies

[rick@rick-hydro:/opt/ros/hydro/share] rosdep check moveit_commander
All system dependencies have been satisified

Please, any ideas why the python script is faulting and how to correct it? Thanks.

2014-06-16 13:59:30 -0500 commented question Moveit Python Demo causes [Errno 9] Bad file descriptor

I think that I resolved the problem just by rebooting. I closed all terminals. Logged out and logged back in. The problem disappeared.

2014-06-16 13:10:17 -0500 asked a question Moveit Python Demo causes [Errno 9] Bad file descriptor

Hello ROS Community,

This is my first post to this forum. I am attempting to run the tutorial for moveit using python. Specifically the Move Group Interface/Python API tutorial. Sorry, my karma is not yet good enough to post links.

  • I am running python 2.7.
  • OS is Ubuntu 12.04
  • ROS and ROS packages are installed using apt-get

I have created a package called my_youbot_moveit with a simple python script. The script contains the following:

import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg

print("============ Starting tutorial setup")
moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node('move_group_python_interface_tutorial', anonymous=True)

When I run the code

source ~/catkin/develop/setup.bash
rosrun my_youbot_moveit my_youbot_moveit.py

I get the error

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 153, in run
    (client_sock, client_addr) = self.server_sock.accept()
  File "/usr/lib/python2.7/socket.py", line 202, in accept
    sock, addr = self._sock.accept()
  File "/usr/lib/python2.7/socket.py", line 170, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor

Please help me understand what is causing this problem and how to solve it.

2014-06-16 13:07:06 -0500 asked a question Moveit Python Demo causes [Errno 9] Bad file descriptor

Hello ROS Community,

This is my first post to this forum. I am attempting to run the tutorial for moveit using python. Specifically the Move Group Interface/Python API tutorial. Sorry, my karma is not yet good enough to post links.

  • I am running python 2.7.
  • OS is Ubuntu 12.04
  • ROS and ROS packages are installed using apt-get

I have created a package called my_youbot_moveit with a simple python script. The script contains the following:

import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg

print("============ Starting tutorial setup")
moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node('move_group_python_interface_tutorial', anonymous=True)

When I run the code

source ~/catkin/develop/setup.bash
rosrun my_youbot_moveit my_youbot_moveit.py

I get the error

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 153, in run
    (client_sock, client_addr) = self.server_sock.accept()
  File "/usr/lib/python2.7/socket.py", line 202, in accept
    sock, addr = self._sock.accept()
  File "/usr/lib/python2.7/socket.py", line 170, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor

Please help me understand what is causing this problem and how to solve it.