kuriatsu / ros-g29-force-feedback Goto Github PK
View Code? Open in Web Editor NEWros package for logicool g29 steering force feedback control
License: Apache License 2.0
ros package for logicool g29 steering force feedback control
License: Apache License 2.0
In your code
int
cast will be applied to m_loop_rate
rather than m_loop_rate*1000
. If m_loop_rate<1
, then (int)m_loop_rate*1000=0
, which causes the timer to invoke the loop
function as fast as possible instead of the desired rate.
The code should be modified as follows:
timer = this->create_wall_timer(std::chrono::milliseconds((int)(m_loop_rate*1000)),
std::bind(&G29ForceFeedback::loop,this));
This issue may not have a significant impact on the final outcome, and you can choose to ignore it. However, if you decide to make modifications, it is recommended to also update the loop_rate
in g29.yaml to 0.001.(My computer can read information from the G29 steering wheel approximately every 0.002 seconds, so I recommend setting the loop_rate to 0.001 in g29.yaml.)
Thank you for you and your code. I have learned a lot, and I wish you all the best!
The force feedback is vanish after 70 sec when I try to upload the torque from the calcCenteringForce() function.
force feedback supported is fine and all init work well. first 70 sec the force feedback works very well after that it vanish all of the sudden.
Do you happen to know if it works on the G27?
@kuriatsu
It appears that PID controlled handle feedback was previously implemented, what is the reason for changing it to the current code?
I tried using the Ros1 branch to test it, but the g29_force_feedback.cpp had a few errors. I also think the package name did not matched because in one place was g29_steering_wheel and another was ros_g29_steering_wheel.
Also in the example code carla_control.py there is also a few mistakes that break the code like having init() with a client argument and also on timer_cb().
I also got another error in publishing with ros in that script because you have rospy.Publisher("/ff_target", ForceFeedback, 10) instead of rospy.Publisher("/ff_target", ForceFeedback, queue_size=10).
I fixed all of this and successfully used it and tested it.
I can create a pull request if you want to have a look
ros2 bag record which topic
I am quite new sorry, but how to connect with my Carla Server for manual control?
Hi @kuriatsu ,
Thanks for your great works.
As the title says,
Could you share the demo code of Carla ?
Thanks you.
hello.
My system environment is Ubuntu 20.04, and my ROS 2 version is Foxy. I checked that my kernel supports force feedback as follows:
nc@nc:~/ros2_ws$ cat /boot/config-5.15.0-105-generic | grep CONFIG_LOGIWHEELS_FF
CONFIG_LOGIWHEELS_FF=y
But when I run [ros2 launch ros_g29_force_feedback g29_feedback.launch.py], I get the following results:
[INFO] [launch]: Default logging verbosity is set to INFO
--> Found handler at /dev/input/event5
[INFO] [g29_force_feedback-1]: process started with pid [5845]
[g29_force_feedback-1] Opening device : /dev/input/event5
[g29_force_feedback-1] device opened
[g29_force_feedback-1] FF_CONSTANT : 82
[g29_force_feedback-1] ERROR: force feedback is not supported
[ERROR] [g29_force_feedback-1]: process has died [pid 5845, exit code 1, cmd '/home/nc/ros2_ws/install/ros_g29_force_feedback/lib/ros_g29_force_feedback/g29_force_feedback --ros-args -r __node:=g29_force_feedback -r __ns:=/ --params-file /home/nc/ros2_ws/install/ros_g29_force_feedback/share/ros_g29_force_feedback/config/g29.yaml --params-file /tmp/launch_params_8fsyn5sx'].
How can I solve this problem? Looking forward to your reply.
Does that package work normally when I use the G923?
rostopic pub /ff_target g29-force-feedback/ForceFeedback "header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: ''
angle: 0.3
force: 0.0
pid_mode: true"
This example has typos, it should be
rostopic pub /ff_target g29_force_feedback/ForceFeedback "header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: ''
angle: 0.3
force: 0.0
pid_mode: true"
rosrun ros_g29_force_feedback ros_g29_force_feedback_node --ros-args --params-file catkin_ws/src/ros_g29_force_feedback/config/g29.yaml
ERROR: cannot open device : /dev/input/event14
Already change the event number in .yaml file, but still not working...
I test this package, there will be back and forth shock, whether this is normal ?
Hello @kuriatsu,
As mentioned in the title, how would we connect this Logitech G29 force feedback with LGSVL simulator? I have tried to install ROS2 bridge for LGSVL, but it is not working at all.
Thank you
Hello.
First of all, I checked the operation of the package you developed in the Noetic environment. (using g29, g923 wii be tested )
I'm curious about the source code of the package
Can I get raw data or adjust gain value and Autocenter strength like oversteer?
I am on Ubuntu 18.04 with ROS1 and following your readme in that branch I get the following error when I run catkin build.
Running a clean install and running catkin_make gives the same error.
catkin_ws/src/ros-g29-force-feedback/src/g29_force_feedback.cpp:8:10: fatal error: ros_g29_force_feedback/ForceFeedback.h: No such file or directory
#include "ros_g29_force_feedback/ForceFeedback.h"
Hi !
In other CARLA test files, my steering wheel has already encountered resistance. but when I was running ~/catkin_ws/src/ros-g29-force-feedback/examples$ python3.8 carla_control.py, the error 'No module named' ros_g29_force_feedback 'was reported. May I ask how to resolve it? Or is there any other way to test whether the steering wheel can be controlled in reverse through code?
My Carla platform is installed on windows platform and I have installed ROS2-foxy. but I don't know how to realize the operation with linux counterpart in windows platform, how to utilize your method in windows platform?
@kuriatsu Is this code correct?
https://github.com/kuriatsu/ros-g29-force-feedback/blob/master/src/g29_force_feedback.cpp#L92
When the loop_rate is 10Hz, it seems that the timer is set to 10 seconds. Does loop_rate refer to timer_period rather than the cycle?
Additionally, if loop_rate indicates frequency, is the following code as you intended?
https://github.com/kuriatsu/ros-g29-force-feedback/blob/master/src/g29_force_feedback.cpp#L149
https://github.com/kuriatsu/ros-g29-force-feedback/blob/master/src/g29_force_feedback.cpp#L153
Hello Kuriatsu:
My environment is ROS noetic on ubuntu 20.04. I had downloaded the code and runned the command line "rosrun ros_g29_force_feedback g29_force_feedback_node".But the code reported error that "
[rospack] Error: package 'ros_g29_force_feedback not found
" . I checked the package.xml and founded that the "
<name>g29_force_feedback</name>
" .So I runned the command line "rosrun ros_g29_force_feedback g29_force_feedback_node". But next I founded that ForceFeedback.msg which contained "
std_msgs/Header header
float32 position
float32 torque
".
However in the examples that taker.py which contained "
g29msg.angle = 0.0
g29msg.force = 0.6
"
The taker.py in the examples did not match the ForceFeedback.msg. Could you help me that how to run the demo?
Thanks.
The package license here is MIT, but the license file is Apache2. Which is correct?
g29-force-feedback
publish /ff_target ros_g29_force_feedback/msg/ForceFeedback "header: {stamp: {sec:0, nanosec:0}, frame_id: ' '}, position: 0.3, torque:0.5"
so I want let position=steering_tire_angle、but i don't know how to achieve it, Can you teach me how to do it
my Email is [email protected]
Thanks you
error info
[ERROR] [rcl]:Failed to parse global arguments
How can I deal with this problem?
carla_control.py is used for ROS2. But I want to connect to Carla with ros1 because I use ubuntu. Could you please share me your code with ros1. Thank you very much !
I have ros melodic installed on my Ubuntu 18. I've followed all the instructions for the installation for ros1 and everything seemed to go smoothly. However even after changing the device name in the config file to let's say /dev/input/event9, I still get the following when doing rosrun
ERROR: cannot open device : /dev/input/event14
I've tried deleting and creating the workspace multiple times, ensured the config file is saved yet it still gives the same error. Can someone help with this?
Thanks for this helpful package.
I am facing an issue with the steering wheel not coming to the state of total rest when no angle is given... it comes to center but keep oscillating left and right.
I tried playing with the PID values but it did not help and increasing the offset does not help either.
Is there a way i can solve this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.