• Y
  • List All
  • Feedback
    • This Project
    • All Projects
Profile Account settings Log out
  • Favorite
  • Project
  • All
Loading...
  • Log in
  • Sign up
yjyoon / ros2_플레이스테이션_컨트롤러 star
  • Project homeH
  • CodeC
  • IssueI
  • Pull requestP
  • Review R
  • MilestoneM
  • BoardB
  • Files
  • Commit
  • Branches
ros2_플레이스테이션_컨트롤러p9n_interfaceincludep9n_interfacep9n_interface.hpp
Download as .zip file
File name
Commit message
Commit date
.github
add ci
2022-06-10
.vscode
add speed factor
2022-07-12
media
Add documents
2022-05-31
p9n_example
add ci
2022-06-10
p9n_interface
fix comment typo
2022-06-18
p9n_node
add speed factor
2022-07-12
p9n_test
Update README.md
2022-06-21
.gitignore
add gitignore
2022-05-27
LICENSE
Initial commit
2022-05-27
README.md
add :heavy_check_mark: (README)
2022-06-18
File name
Commit message
Commit date
.vscode
add basic interface
2022-05-27
include/p9n_interface
support ps4
2022-06-18
src
fix comment typo
2022-06-18
CMakeLists.txt
add basic interface
2022-05-27
package.xml
add example node
2022-05-31
File name
Commit message
Commit date
hw_types.hpp
Dualsense -> DualSense
2022-06-01
p9n_interface.hpp
add test
2022-05-30
ps3_dualshock3.hpp
add PS3 support
2022-06-01
ps4_dualshock4.hpp
support ps4
2022-06-18
ps5_dualsense.hpp
add basic interface
2022-05-27
m12watanabe1a 2022-05-30 6ba3d80 add test UNIX
Raw Open in browser Change history
// Copyright 2022 HarvestX Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #pragma once #include "p9n_interface/hw_types.hpp" #include "p9n_interface/ps3_dualshock3.hpp" #include "p9n_interface/ps4_dualshock4.hpp" #include "p9n_interface/ps5_dualsense.hpp" #include <rclcpp/rclcpp.hpp> #include <sensor_msgs/msg/joy.hpp> namespace p9n_interface { typedef struct { size_t square; size_t circle; size_t triangle; size_t cross; size_t L1; size_t R1; size_t R2; size_t L2; size_t select; size_t start; size_t PS; size_t dpad_up; size_t dpad_down; size_t dpad_right; size_t dpad_left; } JoyButtonIdx; typedef struct { size_t d_pad_x; size_t d_pad_y; size_t stick_lx; size_t stick_ly; size_t stick_rx; size_t stick_ry; size_t R2_analog; size_t L2_analog; } JoyAxesIdx; std::string getAllHwName(); std::string getHwName(const HW_TYPE &); HW_TYPE getHwType(const std::string & hw_name); class PlayStationInterface { private: HW_TYPE HW_TYPE_; sensor_msgs::msg::Joy::ConstSharedPtr joy_; const rclcpp::Logger LOGGER_; std::unique_ptr<JoyButtonIdx> btn_idx_; std::unique_ptr<JoyAxesIdx> axes_idx_; private: bool isAvailable(); public: explicit PlayStationInterface(const HW_TYPE); void setJoyMsg(sensor_msgs::msg::Joy::ConstSharedPtr); bool pressedAny(); bool pressedSquare(); bool pressedCircle(); bool pressedTriangle(); bool pressedCross(); bool pressedL1(); bool pressedR1(); bool pressedR2(); bool pressedL2(); bool pressedSelect(); bool pressedStart(); bool pressedPS(); bool pressedDPadUp(); bool pressedDPadDown(); bool pressedDPadLeft(); bool pressedDPadRight(); float pressedDPadX(); float pressedDPadY(); float tiltedStickLX(); float tiltedStickLY(); float tiltedStickRX(); float tiltedStickRY(); float pressedR2Analog(); float pressedL2Analog(); }; } // namespace p9n_interface

          
        
    
    
Copyright Yona authors & © NAVER Corp. & NAVER LABS Supported by NAVER CLOUD PLATFORM

or
Sign in with github login with Google Sign in with Google
Reset password | Sign up