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

Revision history [back]

click to hide/show revision 1
initial version

Hello there!

The problem is in the smart_grasper.py script, within the constructor of the SmartGrasper class (https://bitbucket.org/theconstructcore/shadow_robot_smart_grasping_sandbox/src/35284d92aa083c929b235f075e4b20d368fc2d90/smart_grasping_sandbox/smart_grasping_sandbox/src/smart_grasping_sandbox/smart_grasper.py#lines-34).

In the shadow_tc_env.py script (line 172), you are sending an argument to this class, here:

self.sgs = SmartGrasper(init_ros_node=False)

But as you can see in the class constructor, this argument is not expected, so it crashes. You need to add this argument to the constructor of the class (in the smart_grasper.py script), like this:

def __init__(self, init_ros_node=True):

Then, this argument is supposed to control if a ROS node is initiated or not, so you should do something like this inside the constructor:

if init_ros_node:
    rospy.init_node("smart_grasper")
else:
    pass

So, when the init_ros_node argument is set to True, the ROS node will be initiated, and when it's set to False, it won't.

I tested the training with this modifications and it works correctly. You can have a look at this video if you want.