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

I made a few changes in the code (below) and this worked fine. Here, i declared j1 as a global variable and initialized it as 0. This worked.

if ((data.buttons[0]==1) and (data.axes[6]==1)):
    time.sleep(1)
    j1 += 0.1
    if (j1 >= 3.1): 
        group1_variable_values[0] = 3.1
        print "Limit reached joint 1"
    else:
        print "changing joint 1"
        group1_variable_values[0] = j1