|
|
The following how-to guides explain how to send navigation commands to the navigator.
navigator without requiring extensive customization.This example demonstrates how to implement a navigation client. It covers three key steps: (1) adding the navigator as a dependency to your component, (2) configuring your client, and (3) sending navigation commands.
To begin, your component needs access to the navigator component. Add the following header to the Component.h file to include the necessary symbols:
In the component's header file, include the following:
The armarx::navigation::client::ComponentPluginUser provides access to the navigator.
The armem::ListeningClientPluginUser is essential for receiving updates from the memory, such as events. To enable this, extend the component's interface by modifying the ComponentInterface.ice file to include the MemoryListenerInterface:
The client must register itself with the navigator to specify the configuration of the navigation stack it will use. This configuration determines the behavior of navigation requests sent by the client.
Now, configure the navigation stack for your client. Start with the general configuration:
For global planning, use the following configuration:
In this example, local planning is not used. For the trajectory controller, configure parameters such as velocity limits:
Combine these configurations into a complete navigation stack configuration:
Finally, register this configuration with the navigator server:
This step ensures that navigation requests from this client will use the specified configuration. You can verify this by checking the navigation memory (using the MemoryViewer widget), where an entry should now exist in the Navigation/Parameterization core segment with the name of your component.
To move the robot, specify the target coordinates. For example, to navigate to the global position [1000, 1000]:
Send the navigation command:
The robot will start moving toward the specified target. To wait until the robot reaches its goal, use the following:
The StopEvent provides information about whether the goal was reached or if a failure occurred. For example:
Congratulations! You have successfully implemented a navigation client that can send commands and handle events. The robot should now navigate to the specified target or provide feedback if an issue arises.
This example demonstrates how to implement a navigation client. It covers three key steps: (1) adding the navigator as a dependency to your component, (2) configuring your client, and (3) sending navigation commands.
To begin, your component needs access to the navigator component. Add the following header to the Component.h file to include the necessary symbols:
Next, add the navigator (armarx::navigation::client::NavigatorInterfacePrx) as a dependency to your component, along with the wrapper armarx::navigation::client::IceNavigator. The IceNavigator abstracts the underlying middleware (ZeroC Ice) and implements the armarx::navigation::core::NavigatorInterface.
In the component's header file, include the following:
The armem::ListeningClientPluginUser is essential for receiving updates from the memory, such as events. To enable this, extend the component's interface by modifying the ComponentInterface.ice file to include the MemoryListenerInterface:
In the source file, register the navigator as a dependency:
Then, connect the navigator to the IceNavigator:
At this point, your component can connect to the navigator. However, you still need to configure your client to define the desired behavior, such as the robot's maximum velocity.
The client must register itself with the navigator to specify the configuration of the navigation stack it will use. This configuration determines the behavior of navigation requests sent by the client.
First, set the name of the client. This ensures that only events relevant to this client are handled:
Next, instantiate the event subscriber to handle planned events (e.g., movement started, goal reached) and failures:
Create the client navigator, which will allow us to send navigation commands to the navigator component.
Now, configure the navigation stack for your client. Start with the general configuration:
For global planning, use the following configuration:
In this example, local planning is not used. For the trajectory controller, configure parameters such as velocity limits:
Combine these configurations into a complete navigation stack configuration:
Finally, register this configuration with the navigator server:
This step ensures that navigation requests from this client will use the specified configuration. You can verify this by checking the navigation memory (using the MemoryViewer widget), where an entry should now exist in the Navigation/Parameterization core segment with the name of your component.
To move the robot, specify the target coordinates. For example, to navigate to the global position [1000, 1000]:
Send the navigation command:
The robot will start moving toward the specified target. To wait until the robot reaches its goal, use the following:
The StopEvent provides information about whether the goal was reached or if a failure occurred. For example:
Congratulations! You have successfully implemented a navigation client that can send commands and handle events. The robot should now navigate to the specified target or provide feedback if an issue arises.
The available skills, e.g., NavigateTo show the use of the navigator API including failure / event handling. Therefore, this implementation should be consulted and can be copied.
An example component shows several use cases of a navigation client. This includes
The use case can be selected through the mode property of the component.