Skip to content

Commit

Permalink
refactor(joy_controller)!: prefix package and namespace with autoware (
Browse files Browse the repository at this point in the history
…#7382)

* add prefix

Signed-off-by: Takayuki Murooka <[email protected]>

* fix codeowner

Signed-off-by: Takayuki Murooka <[email protected]>

* fix

Signed-off-by: Takayuki Murooka <[email protected]>

* fix

Signed-off-by: Takayuki Murooka <[email protected]>

---------

Signed-off-by: Takayuki Murooka <[email protected]>
  • Loading branch information
takayuki5168 authored and KhalilSelyan committed Jul 22, 2024
1 parent e45b5dd commit 0da40e2
Show file tree
Hide file tree
Showing 20 changed files with 86 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
20 changes: 20 additions & 0 deletions control/autoware_joy_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.14)
project(autoware_joy_controller)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(autoware_joy_controller_node SHARED
DIRECTORY src
)

rclcpp_components_register_node(autoware_joy_controller_node
PLUGIN "autoware::joy_controller::AutowareJoyControllerNode"
EXECUTABLE autoware_joy_controller
)

ament_auto_package(
INSTALL_TO_SHARE
launch
config
)
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# joy_controller
# autoware_joy_controller

## Role

`joy_controller` is the package to convert a joy msg to autoware commands (e.g. steering wheel, shift, turn signal, engage) for a vehicle.
`autoware_joy_controller` is the package to convert a joy msg to autoware commands (e.g. steering wheel, shift, turn signal, engage) for a vehicle.

## Usage

### ROS 2 launch

```bash
# With default config (ds4)
ros2 launch joy_controller joy_controller.launch.xml
ros2 launch autoware_joy_controller joy_controller.launch.xml

# Default config but select from the existing parameter files
ros2 launch joy_controller joy_controller_param_selection.launch.xml joy_type:=ds4 # or g29, p65, xbox
ros2 launch autoware_joy_controller joy_controller_param_selection.launch.xml joy_type:=ds4 # or g29, p65, xbox

# Override the param file
ros2 launch joy_controller joy_controller.launch.xml config_file:=/path/to/your/param.yaml
ros2 launch autoware_joy_controller joy_controller.launch.xml config_file:=/path/to/your/param.yaml
```

## Input / Output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef JOY_CONTROLLER__JOY_CONTROLLER_HPP_
#define JOY_CONTROLLER__JOY_CONTROLLER_HPP_
#ifndef AUTOWARE_JOY_CONTROLLER__JOY_CONTROLLER_HPP_
#define AUTOWARE_JOY_CONTROLLER__JOY_CONTROLLER_HPP_

#include "joy_controller/joy_converter/joy_converter_base.hpp"
#include "autoware_joy_controller/joy_converter/joy_converter_base.hpp"

#include <rclcpp/rclcpp.hpp>
#include <tier4_autoware_utils/ros/polling_subscriber.hpp>
Expand All @@ -37,7 +37,7 @@
#include <memory>
#include <string>

namespace joy_controller
namespace autoware::joy_controller
{
using GearShiftType = tier4_external_api_msgs::msg::GearShift::_data_type;
using TurnSignalType = tier4_external_api_msgs::msg::TurnSignal::_data_type;
Expand Down Expand Up @@ -120,6 +120,6 @@ class AutowareJoyControllerNode : public rclcpp::Node
bool isDataReady();
void onTimer();
};
} // namespace joy_controller
} // namespace autoware::joy_controller

#endif // JOY_CONTROLLER__JOY_CONTROLLER_HPP_
#endif // AUTOWARE_JOY_CONTROLLER__JOY_CONTROLLER_HPP_
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 JOY_CONTROLLER__JOY_CONVERTER__DS4_JOY_CONVERTER_HPP_
#define JOY_CONTROLLER__JOY_CONVERTER__DS4_JOY_CONVERTER_HPP_
#ifndef AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__DS4_JOY_CONVERTER_HPP_
#define AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__DS4_JOY_CONVERTER_HPP_

#include "joy_controller/joy_converter/joy_converter_base.hpp"
#include "autoware_joy_controller/joy_converter/joy_converter_base.hpp"

#include <algorithm>

namespace joy_controller
namespace autoware::joy_controller
{
class DS4JoyConverter : public JoyConverterBase
{
Expand Down Expand Up @@ -90,6 +90,6 @@ class DS4JoyConverter : public JoyConverterBase

bool reverse() const { return Share(); }
};
} // namespace joy_controller
} // namespace autoware::joy_controller

#endif // JOY_CONTROLLER__JOY_CONVERTER__DS4_JOY_CONVERTER_HPP_
#endif // AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__DS4_JOY_CONVERTER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef JOY_CONTROLLER__JOY_CONVERTER__G29_JOY_CONVERTER_HPP_
#define JOY_CONTROLLER__JOY_CONVERTER__G29_JOY_CONVERTER_HPP_
#ifndef AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__G29_JOY_CONVERTER_HPP_
#define AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__G29_JOY_CONVERTER_HPP_

#include "joy_controller/joy_converter/joy_converter_base.hpp"
#include "autoware_joy_controller/joy_converter/joy_converter_base.hpp"

namespace joy_controller
namespace autoware::joy_controller
{
class G29JoyConverter : public JoyConverterBase
{
Expand Down Expand Up @@ -88,6 +88,6 @@ class G29JoyConverter : public JoyConverterBase

bool reverse() const { return Share(); }
};
} // namespace joy_controller
} // namespace autoware::joy_controller

#endif // JOY_CONTROLLER__JOY_CONVERTER__G29_JOY_CONVERTER_HPP_
#endif // AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__G29_JOY_CONVERTER_HPP_
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 JOY_CONTROLLER__JOY_CONVERTER__JOY_CONVERTER_BASE_HPP_
#define JOY_CONTROLLER__JOY_CONVERTER__JOY_CONVERTER_BASE_HPP_
#ifndef AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__JOY_CONVERTER_BASE_HPP_
#define AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__JOY_CONVERTER_BASE_HPP_

#include <sensor_msgs/msg/joy.hpp>

#include <algorithm>

namespace joy_controller
namespace autoware::joy_controller
{
class JoyConverterBase
{
Expand Down Expand Up @@ -50,6 +50,6 @@ class JoyConverterBase
virtual bool vehicle_engage() const = 0;
virtual bool vehicle_disengage() const = 0;
};
} // namespace joy_controller
} // namespace autoware::joy_controller

#endif // JOY_CONTROLLER__JOY_CONVERTER__JOY_CONVERTER_BASE_HPP_
#endif // AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__JOY_CONVERTER_BASE_HPP_
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 JOY_CONTROLLER__JOY_CONVERTER__P65_JOY_CONVERTER_HPP_
#define JOY_CONTROLLER__JOY_CONVERTER__P65_JOY_CONVERTER_HPP_
#ifndef AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__P65_JOY_CONVERTER_HPP_
#define AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__P65_JOY_CONVERTER_HPP_

#include "joy_controller/joy_converter/joy_converter_base.hpp"
#include "autoware_joy_controller/joy_converter/joy_converter_base.hpp"

#include <algorithm>

namespace joy_controller
namespace autoware::joy_controller
{
class P65JoyConverter : public JoyConverterBase
{
Expand Down Expand Up @@ -76,6 +76,6 @@ class P65JoyConverter : public JoyConverterBase

const sensor_msgs::msg::Joy j_;
};
} // namespace joy_controller
} // namespace autoware::joy_controller

#endif // JOY_CONTROLLER__JOY_CONVERTER__P65_JOY_CONVERTER_HPP_
#endif // AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__P65_JOY_CONVERTER_HPP_
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 JOY_CONTROLLER__JOY_CONVERTER__XBOX_JOY_CONVERTER_HPP_
#define JOY_CONTROLLER__JOY_CONVERTER__XBOX_JOY_CONVERTER_HPP_
#ifndef AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__XBOX_JOY_CONVERTER_HPP_
#define AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__XBOX_JOY_CONVERTER_HPP_

#include "joy_controller/joy_converter/joy_converter_base.hpp"
#include "autoware_joy_controller/joy_converter/joy_converter_base.hpp"

#include <algorithm>

namespace joy_controller
namespace autoware::joy_controller
{
class XBOXJoyConverter : public JoyConverterBase
{
Expand Down Expand Up @@ -76,6 +76,6 @@ class XBOXJoyConverter : public JoyConverterBase

const sensor_msgs::msg::Joy j_;
};
} // namespace joy_controller
} // namespace autoware::joy_controller

#endif // JOY_CONTROLLER__JOY_CONVERTER__XBOX_JOY_CONVERTER_HPP_
#endif // AUTOWARE_JOY_CONTROLLER__JOY_CONVERTER__XBOX_JOY_CONVERTER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<arg name="output_gate_mode" default="/control/gate_mode_cmd"/>
<arg name="output_vehicle_engage" default="/vehicle/engage"/>

<arg name="config_file" default="$(find-pkg-share joy_controller)/config/joy_controller_ds4.param.yaml"/>
<arg name="config_file" default="$(find-pkg-share autoware_joy_controller)/config/joy_controller_ds4.param.yaml"/>

<node pkg="joy_controller" exec="joy_controller" name="joy_controller" output="screen">
<node pkg="autoware_joy_controller" exec="autoware_joy_controller" name="joy_controller" output="screen">
<remap from="input/joy" to="$(var input_joy)"/>
<remap from="input/odometry" to="$(var input_odometry)"/>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<launch>
<arg name="joy_type" default="ds4" description="options: ds4, g29, p65, xbox"/>

<include file="$(find-pkg-share autoware_joy_controller)/launch/joy_controller.launch.xml">
<arg name="config_file" value="$(find-pkg-share autoware_joy_controller)/config/joy_controller_$(var joy_type).param.yaml"/>
</include>
</launch>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>joy_controller</name>
<name>autoware_joy_controller</name>
<version>0.1.0</version>
<description>The joy_controller package</description>
<description>The autoware_joy_controller package</description>
<maintainer email="[email protected]">Taiki Tanaka</maintainer>
<maintainer email="[email protected]">Tomoya Kimura</maintainer>
<maintainer email="[email protected]">Shumpei Wakabayashi</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Parameters for Joy Controller node",
"type": "object",
"definitions": {
"joy_controller": {
"autoware_joy_controller": {
"type": "object",
"properties": {
"joy_type": {
Expand Down Expand Up @@ -112,7 +112,7 @@
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/joy_controller"
"$ref": "#/definitions/autoware_joy_controller"
}
},
"required": ["ros__parameters"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "joy_controller/joy_controller.hpp"
#include "joy_controller/joy_converter/ds4_joy_converter.hpp"
#include "joy_controller/joy_converter/g29_joy_converter.hpp"
#include "joy_controller/joy_converter/p65_joy_converter.hpp"
#include "joy_controller/joy_converter/xbox_joy_converter.hpp"
#include "autoware_joy_controller/joy_controller.hpp"
#include "autoware_joy_controller/joy_converter/ds4_joy_converter.hpp"
#include "autoware_joy_controller/joy_converter/g29_joy_converter.hpp"
#include "autoware_joy_controller/joy_converter/p65_joy_converter.hpp"
#include "autoware_joy_controller/joy_converter/xbox_joy_converter.hpp"

#include <tier4_api_utils/tier4_api_utils.hpp>

Expand All @@ -27,9 +27,9 @@

namespace
{
using joy_controller::GateModeType;
using joy_controller::GearShiftType;
using joy_controller::TurnSignalType;
using autoware::joy_controller::GateModeType;
using autoware::joy_controller::GearShiftType;
using autoware::joy_controller::TurnSignalType;
using GearShift = tier4_external_api_msgs::msg::GearShift;
using TurnSignal = tier4_external_api_msgs::msg::TurnSignal;
using GateMode = tier4_control_msgs::msg::GateMode;
Expand Down Expand Up @@ -146,7 +146,7 @@ double calcMapping(const double input, const double sensitivity)

} // namespace

namespace joy_controller
namespace autoware::joy_controller
{
void AutowareJoyControllerNode::onJoy()
{
Expand Down Expand Up @@ -459,7 +459,7 @@ void AutowareJoyControllerNode::initTimer(double period_s)
}

AutowareJoyControllerNode::AutowareJoyControllerNode(const rclcpp::NodeOptions & node_options)
: Node("joy_controller", node_options)
: Node("autoware_joy_controller", node_options)
{
// Parameter
joy_type_ = declare_parameter<std::string>("joy_type");
Expand Down Expand Up @@ -521,7 +521,7 @@ AutowareJoyControllerNode::AutowareJoyControllerNode(const rclcpp::NodeOptions &
// Timer
initTimer(1.0 / update_rate_);
}
} // namespace joy_controller
} // namespace autoware::joy_controller

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(joy_controller::AutowareJoyControllerNode)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::joy_controller::AutowareJoyControllerNode)
20 changes: 0 additions & 20 deletions control/joy_controller/CMakeLists.txt

This file was deleted.

This file was deleted.

0 comments on commit 0da40e2

Please sign in to comment.