Forums Niryo One Programming Niryo One Stop command Reply To: Stop command

Edouard Renard
Post count: 239

Thanks. For now the move commands from the Python API are synchronous, so you can’t stop one in the main execution thread. This has been made like that to simplify things. The Python API is targeted to beginner/intermediate programmers. For advanced programmers, or if you want to do much more complex applications, you’d have to start using the ROS communication tools (Python or C++).

What you can do from that:

1. Still use the Python API and work with multiple threads. In one thread you execute the move_joint() or move_pose() or shift_pose(). In another thread, you can create a simple ROS publisher and publish an message (type:  actionlib_msgs/GoalID) on the “/niryo_one/commander/robot_action/cancel” topic. You can find here a tutorial to do that quickly.

2. If you really want to go to the next step and create more complex applications where you have more control, then start using ROS and create your own nodes that will use the other Niryo One nodes. See this guide to get started with Niryo One ROS stack.

I hope this helps!