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

Revision history [back]

You should initalise ros node with:

rospy.init_node()

for explanation check here.

So you should have at least something like this:

if __name__ == '__main__':

    rospy.init_node('xbox_controller')

    try:
        loop = asyncio.get_event_loop()
        loop.add_reader(xboxc, partial(read_events, xboxc))
        loop.run_until_complete(summarize())

    except rospy.ROSInterruptException:

            pass

But if you use xbox controller with ROS probably you want to use joy package.

You should initalise ros node with:with: rospy.init_node()

rospy.init_node()

for explanation check here.

So you should have at least something like this:

if __name__ == '__main__':

    rospy.init_node('xbox_controller')

    try:
        loop = asyncio.get_event_loop()
        loop.add_reader(xboxc, partial(read_events, xboxc))
        loop.run_until_complete(summarize())

    except rospy.ROSInterruptException:

            pass

But if you use xbox controller with ROS probably you want to use joy package.

You should initalise ros node with: rospy.init_node()with:

rospy.init_node()

for explanation check here.

So you should have at least write something like this:

if __name__ == '__main__':

    rospy.init_node('xbox_controller')

    try:
        loop = asyncio.get_event_loop()
        loop.add_reader(xboxc, partial(read_events, xboxc))
        loop.run_until_complete(summarize())

    except rospy.ROSInterruptException:

            pass

But if you use xbox controller with ROS probably you want to use joy package.