From db4cc11602fedee68dd99d39471d1d0ba9c9b05e Mon Sep 17 00:00:00 2001 From: Shih-Yuan Liu Date: Sat, 12 Dec 2015 00:34:10 +0800 Subject: [PATCH] Add joy_mapper_test.launch to test joy_mapper. Output steering and speed between -1 an 1. --- catkin_ws/.gitignore | 4 ++-- .../src/joy_mapper/launch/joy_mapper_test.launch | 12 ++++++++++++ catkin_ws/src/joy_mapper/script/joy_mapper.py | 8 ++++---- 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 catkin_ws/src/joy_mapper/launch/joy_mapper_test.launch diff --git a/catkin_ws/.gitignore b/catkin_ws/.gitignore index 7409b2073b..f936c19f60 100644 --- a/catkin_ws/.gitignore +++ b/catkin_ws/.gitignore @@ -1,2 +1,2 @@ -devel/ -build/ \ No newline at end of file +build/ +devel/ \ No newline at end of file diff --git a/catkin_ws/src/joy_mapper/launch/joy_mapper_test.launch b/catkin_ws/src/joy_mapper/launch/joy_mapper_test.launch new file mode 100644 index 0000000000..437d69c915 --- /dev/null +++ b/catkin_ws/src/joy_mapper/launch/joy_mapper_test.launch @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/catkin_ws/src/joy_mapper/script/joy_mapper.py b/catkin_ws/src/joy_mapper/script/joy_mapper.py index d5bee2f2f9..a6ec243d5e 100755 --- a/catkin_ws/src/joy_mapper/script/joy_mapper.py +++ b/catkin_ws/src/joy_mapper/script/joy_mapper.py @@ -11,8 +11,8 @@ def __init__(self): # Setup Parameters self.pub_timestep = self.setupParam("~pub_timestep",0.02) - self.speed_gain = self.setupParam("~speed_gain",1.0) - self.steer_gain = self.setupParam("~steer_gain",np.pi*(15.0/180.0)) + # self.speed_gain = self.setupParam("~speed_gain",1.0) + # self.steer_gain = self.setupParam("~steer_gain",np.pi*(15.0/180.0)) # Publications self.pub_control = rospy.Publisher("~joy_control",CarControl,queue_size=1) @@ -38,8 +38,8 @@ def cbLaneControl(self,lane_control_msg): def publishControl(self,event): car_control_msg = CarControl() car_control_msg.need_steering = False - car_control_msg.speed = self.joy.axes[1]*self.speed_gain #Left stick V-axis. Up is positive - car_control_msg.steering = self.joy.axes[3]*self.steer_gain #Right stick H-axis. Right is negative + car_control_msg.speed = self.joy.axes[1] #*self.speed_gain #Left stick V-axis. Up is positive + car_control_msg.steering = self.joy.axes[3] #*self.steer_gain #Right stick H-axis. Right is negative self.pub_control.publish(car_control_msg)