Skip to content

Commit

Permalink
Change package names from ignition_ to ign_ (#19)
Browse files Browse the repository at this point in the history
* Change package names from ignition_ to ign_

Signed-off-by: ahcorde <ahcorde@gmail.com>
  • Loading branch information
ahcorde committed Jan 6, 2022
1 parent 40873bb commit 45d7ef2
Show file tree
Hide file tree
Showing 29 changed files with 131 additions and 109 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
run: |
cd /home/ros2_ws/
. /opt/ros/galactic/local_setup.sh
colcon build --packages-up-to ignition_ros2_control_demos
colcon build --packages-up-to ign_ros2_control_demos
- name: Run tests
id: test
run: |
cd /home/ros2_ws/
. /opt/ros/galactic/local_setup.sh
colcon test --event-handlers console_direct+ --packages-select ignition_ros2_control ignition_ros2_control_demos
colcon test --event-handlers console_direct+ --packages-select ign_ros2_control ign_ros2_control_demos
colcon test-result
2 changes: 1 addition & 1 deletion Dockerfile/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ RUN cd /home/ros2_ws/ \
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

CMD ros2 launch ignition_ros2_control_demos cart_example_position.launch.py
CMD ros2 launch ign_ros2_control_demos cart_example_position.launch.py
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If you want to run this with `ROS 2 Foxy` please check the branch `foxy`.

```bash
cd Dockerfile
docker build -t ignition_ros2_control .
docker build -t ign_ros2_control .
```

### To run the demo
Expand All @@ -37,7 +37,7 @@ docker build -t ignition_ros2_control .
Docker allows us to run the demo without the GUI if configured properly. The following command runs the demo without the GUI:

```bash
docker run -it --rm --name ignition_ros2_control_demo --net host ignition_ros2_control ros2 launch ignition_ros2_control_demos cart_example_position.launch.py gui:=false
docker run -it --rm --name ignition_ros2_control_demo --net host ign_ros2_control ros2 launch ign_ros2_control_demos cart_example_position.launch.py gui:=false
```

Then on your local machine, you can run the Gazebo client:
Expand All @@ -55,15 +55,15 @@ mounting file permissions. You can install this tool with the following [instruc
The following command will launch Ignition:

```bash
rocker --x11 --nvidia --name ignition_ros2_control_demo ignition_ros2_control:latest
rocker --x11 --nvidia --name ignition_ros2_control_demo ign_ros2_control:latest
```

The following commands allow the cart to be moved along the rail:

```bash
docker exec -it ignition_ros2_control_demo bash
source /home/ros2_ws/install/setup.bash
ros2 run ignition_ros2_control_demos example_position
ros2 run ign_ros2_control_demos example_position
```

## Add ros2_control tag to a URDF
Expand All @@ -78,7 +78,7 @@ include:
```xml
<ros2_control name="IgnitionSystem" type="system">
<hardware>
<plugin>ignition_ros2_control/IgnitionSystem</plugin>
<plugin>ign_ros2_control/IgnitionSystem</plugin>
</hardware>
<joint name="slider_to_cart">
<command_interface name="effort">
Expand All @@ -92,56 +92,56 @@ include:
</ros2_control>
```

## Add the ignition_ros2_control plugin
## Add the ign_ros2_control plugin

In addition to the `ros2_control` tags, a Gazebo plugin needs to be added to your URDF that
actually parses the `ros2_control` tags and loads the appropriate hardware interfaces and
controller manager. By default the `ignition_ros2_control` plugin is very simple, though it is also
controller manager. By default the `ign_ros2_control` plugin is very simple, though it is also
extensible via an additional plugin architecture to allow power users to create their own custom
robot hardware interfaces between `ros2_control` and Gazebo.

```xml
<gazebo>
<plugin filename="libignition_ros2_control.so" name="ignition_ros2_control">
<plugin filename="libignition_ros2_control.so" name="ign_ros2_control">
<robot_param>robot_description</robot_param>
<robot_param_node>robot_state_publisher</robot_param_node>
<parameters>$(find ignition_ros2_control_demos)/config/cartpole_controller.yaml</parameters>
<parameters>$(find ign_ros2_control_demos)/config/cartpole_controller.yaml</parameters>
</plugin>
</gazebo>
```

The `ignition_ros2_control` `<plugin>` tag also has the following optional child elements:
The `ign_ros2_control` `<plugin>` tag also has the following optional child elements:

- `<parameters>`: YAML file with the configuration of the controllers

#### Default ignition_ros2_control Behavior
#### Default ign_ros2_control Behavior

By default, without a `<plugin>` tag, `ignition_ros2_control` will attempt to get all of the information it needs to interface with a ros2_control-based controller out of the URDF. This is sufficient for most cases, and good for at least getting started.
By default, without a `<plugin>` tag, `ign_ros2_control` will attempt to get all of the information it needs to interface with a ros2_control-based controller out of the URDF. This is sufficient for most cases, and good for at least getting started.

The default behavior provides the following ros2_control interfaces:

- hardware_interface::JointStateInterface
- hardware_interface::EffortJointInterface
- hardware_interface::VelocityJointInterface

#### Advanced: custom ignition_ros2_control Simulation Plugins
#### Advanced: custom ign_ros2_control Simulation Plugins

The `ignition_ros2_control` Gazebo plugin also provides a pluginlib-based interface to implement custom interfaces between Gazebo and `ros2_control` for simulating more complex mechanisms (nonlinear springs, linkages, etc).
The `ign_ros2_control` Gazebo plugin also provides a pluginlib-based interface to implement custom interfaces between Gazebo and `ros2_control` for simulating more complex mechanisms (nonlinear springs, linkages, etc).

These plugins must inherit the `ignition_ros2_control::IgnitionSystemInterface`, which implements a simulated `ros2_control`
These plugins must inherit the `ign_ros2_control::IgnitionSystemInterface`, which implements a simulated `ros2_control`
`hardware_interface::SystemInterface`. SystemInterface provides API-level access to read and command joint properties.

The respective IgnitionSystemInterface sub-class is specified in a URDF model and is loaded when the
robot model is loaded. For example, the following XML will load the default plugin:
```xml
<ros2_control name="IgnitionSystem" type="system">
<hardware>
<plugin>ignition_ros2_control/IgnitionSystem</plugin>
<plugin>ign_ros2_control/IgnitionSystem</plugin>
</hardware>
...
<ros2_control>
<gazebo>
<plugin name="ignition_ros2_control" filename="libignition_ros2_control.so">
<plugin name="ign_ros2_control" filename="libignition_ros2_control.so">
...
</plugin>
</gazebo>
Expand All @@ -154,8 +154,8 @@ and use the tag `<controller_manager_prefix_node_name>` to set the controller ma

```xml
<gazebo>
<plugin name="ignition_ros2_control" filename="libignition_ros2_control.so">
<parameters>$(find ignition_ros2_control_demos)/config/cartpole_controller.yaml</parameters>
<plugin name="ign_ros2_control" filename="libignition_ros2_control.so">
<parameters>$(find ign_ros2_control_demos)/config/cartpole_controller.yaml</parameters>
<controller_manager_prefix_node_name>controller_manager</controller_manager_prefix_node_name>
</plugin>
<gazebo>
Expand Down Expand Up @@ -184,22 +184,22 @@ cart_pole_controller:
```
#### Executing the examples

There are some examples in the `ignition_ros2_control_demos` package. These examples allow to launch a cart in a 30 meter rail.
There are some examples in the `ign_ros2_control_demos` package. These examples allow to launch a cart in a 30 meter rail.

You can run some of the example configurations by running the following commands:

```bash
ros2 launch ignition_ros2_control_demos cart_example_position.launch.py
ros2 launch ignition_ros2_control_demos cart_example_velocity.launch.py
ros2 launch ignition_ros2_control_demos cart_example_effort.launch.py
ros2 launch ign_ros2_control_demos cart_example_position.launch.py
ros2 launch ign_ros2_control_demos cart_example_velocity.launch.py
ros2 launch ign_ros2_control_demos cart_example_effort.launch.py
```

Send example commands:

When the Gazebo world is launched, you can run some of the following commands to move the cart.

```bash
ros2 run ignition_ros2_control_demos example_position
ros2 run ignition_ros2_control_demos example_velocity
ros2 run ignition_ros2_control_demos example_effort
ros2 run ign_ros2_control_demos example_position
ros2 run ign_ros2_control_demos example_velocity
ros2 run ign_ros2_control_demos example_effort
```
11 changes: 11 additions & 0 deletions ign_ros2_control/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package ign_ros2_control
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.1.0 (2022-05-01)
------------------
* Ignition ros2 control (`#1 <https://github.com/ignitionrobotics/ign_ros2_control/issues/1>`_)
Co-authored-by: ahcorde <ahcorde@gmail.com>
Co-authored-by: Louise Poubel <louise@openrobotics.org>
Co-authored-by: Vatan Aksoy Tezer <vatan@picknik.ai>
* Contributors: Alejandro Hernández Cordero, Louise Poubel, Vatan Aksoy Tezer
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
project(ignition_ros2_control)
project(ign_ros2_control)

# Default to C11
if(NOT CMAKE_C_STANDARD)
Expand Down Expand Up @@ -52,7 +52,7 @@ set(IGN_PLUGIN_VER ${ignition-plugin1_VERSION_MAJOR})
include_directories(include)

add_library(${PROJECT_NAME}-system SHARED
src/ignition_ros2_control_plugin.cpp
src/ign_ros2_control_plugin.cpp
)

target_link_libraries(${PROJECT_NAME}-system
Expand All @@ -72,21 +72,21 @@ ament_target_dependencies(${PROJECT_NAME}-system

#########

add_library(ignition_hardware_plugins SHARED
src/ignition_system.cpp
add_library(ign_hardware_plugins SHARED
src/ign_system.cpp
)
ament_target_dependencies(ignition_hardware_plugins
ament_target_dependencies(ign_hardware_plugins
rclcpp_lifecycle
hardware_interface
rclcpp
)
target_link_libraries(ignition_hardware_plugins
target_link_libraries(ign_hardware_plugins
ignition-gazebo${IGN_GAZEBO_VER}::core
)

## Install
install(TARGETS
ignition_hardware_plugins
ign_hardware_plugins
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
Expand All @@ -99,14 +99,14 @@ if(BUILD_TESTING)
endif()

ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME} ignition_hardware_plugins)
ament_export_libraries(${PROJECT_NAME} ign_hardware_plugins)

# Install directories
install(TARGETS ${PROJECT_NAME}-system
DESTINATION lib
)

pluginlib_export_plugin_description_file(ignition_ros2_control ignition_hardware_plugins.xml)
pluginlib_export_plugin_description_file(ign_ros2_control ign_hardware_plugins.xml)

# Setup the project
ament_package()
File renamed without changes.
10 changes: 10 additions & 0 deletions ign_ros2_control/ign_hardware_plugins.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<library path="ign_hardware_plugins">
<class
name="ign_ros2_control/IgnitionSystem"
type="ign_ros2_control::IgnitionSystem"
base_class_type="ign_ros2_control::IgnitionSystemInterface">
<description>
GazeboPositionJoint
</description>
</class>
</library>
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef IGNITION_ROS2_CONTROL__IGNITION_ROS2_CONTROL_PLUGIN_HPP_
#define IGNITION_ROS2_CONTROL__IGNITION_ROS2_CONTROL_PLUGIN_HPP_
#ifndef IGN_ROS2_CONTROL__IGN_ROS2_CONTROL_PLUGIN_HPP_
#define IGN_ROS2_CONTROL__IGN_ROS2_CONTROL_PLUGIN_HPP_

#include <ignition/gazebo/System.hh>

#include <memory>

namespace ignition_ros2_control
namespace ign_ros2_control
{
// Forward declarations.
class IgnitionROS2ControlPluginPrivate;
Expand Down Expand Up @@ -57,6 +57,6 @@ class IgnitionROS2ControlPlugin
/// \brief Private data pointer.
std::unique_ptr<IgnitionROS2ControlPluginPrivate> dataPtr;
};
} // namespace ignition_ros2_control
} // namespace ign_ros2_control

#endif // IGNITION_ROS2_CONTROL__IGNITION_ROS2_CONTROL_PLUGIN_HPP_
#endif // IGN_ROS2_CONTROL__IGN_ROS2_CONTROL_PLUGIN_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
// limitations under the License.


#ifndef IGNITION_ROS2_CONTROL__IGNITION_SYSTEM_HPP_
#define IGNITION_ROS2_CONTROL__IGNITION_SYSTEM_HPP_
#ifndef IGN_ROS2_CONTROL__IGN_SYSTEM_HPP_
#define IGN_ROS2_CONTROL__IGN_SYSTEM_HPP_

#include <map>
#include <memory>
#include <string>
#include <vector>

#include "ignition_ros2_control/ignition_system_interface.hpp"
#include "ign_ros2_control/ign_system_interface.hpp"
#include "rclcpp_lifecycle/state.hpp"
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"

namespace ignition_ros2_control
namespace ign_ros2_control
{
// Forward declaration
class IgnitionSystemPrivate;

// These class must inherit `ignition_ros2_control::IgnitionSystemInterface` which implements a
// These class must inherit `ign_ros2_control::IgnitionSystemInterface` which implements a
// simulated `ros2_control` `hardware_interface::SystemInterface`.

class IgnitionSystem : public IgnitionSystemInterface
Expand Down Expand Up @@ -78,6 +78,6 @@ class IgnitionSystem : public IgnitionSystemInterface
std::unique_ptr<IgnitionSystemPrivate> dataPtr;
};

} // namespace ignition_ros2_control
} // namespace ign_ros2_control

#endif // IGNITION_ROS2_CONTROL__IGNITION_SYSTEM_HPP_
#endif // IGN_ROS2_CONTROL__IGN_SYSTEM_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.


#ifndef IGNITION_ROS2_CONTROL__IGNITION_SYSTEM_INTERFACE_HPP_
#define IGNITION_ROS2_CONTROL__IGNITION_SYSTEM_INTERFACE_HPP_
#ifndef IGN_ROS2_CONTROL__IGN_SYSTEM_INTERFACE_HPP_
#define IGN_ROS2_CONTROL__IGN_SYSTEM_INTERFACE_HPP_

#include <ignition/gazebo/System.hh>

Expand All @@ -28,7 +28,7 @@
#include <string>
#include <vector>

namespace ignition_ros2_control
namespace ign_ros2_control
{

/// \brief This class allows us to handle flags easily, instead of using strings
Expand Down Expand Up @@ -102,6 +102,6 @@ class IgnitionSystemInterface
rclcpp::Node::SharedPtr nh_;
};

} // namespace ignition_ros2_control
} // namespace ign_ros2_control

#endif // IGNITION_ROS2_CONTROL__IGNITION_SYSTEM_INTERFACE_HPP_
#endif // IGN_ROS2_CONTROL__IGN_SYSTEM_INTERFACE_HPP_
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<package format="3">
<name>ignition_ros2_control</name>
<name>ign_ros2_control</name>
<version>0.0.0</version>
<description>Ignition ros2_control package allows to control simulated robots using ros2_control framework.</description>
<maintainer email="alejandro@openrobotics.com">Alejandro Hernández</maintainer>
Expand Down Expand Up @@ -28,6 +28,6 @@

<export>
<build_type>ament_cmake</build_type>
<ignition_ros2_control plugin="${prefix}/ignition_hardware_plugins.xml"/>
<ign_ros2_control plugin="${prefix}/ign_hardware_plugins.xml"/>
</export>
</package>
Loading

0 comments on commit 45d7ef2

Please sign in to comment.