diff --git a/.gitignore b/.gitignore
index eab1ee1..7403231 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
install/
log/
build/
-.vscode/
\ No newline at end of file
+.vscode/
+
+*__pycache__*
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..2797480
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# DCAITI_WS
+
+## Jetson IP Adresses
+Onboard switch: 192.168.1.253
+TIB switch: 192.168.13.142
\ No newline at end of file
diff --git a/src/dcaiti_control/description/real_robot_control.xacro b/src/dcaiti_control/description/real_robot_control.xacro
index 831da48..460b39a 100644
--- a/src/dcaiti_control/description/real_robot_control.xacro
+++ b/src/dcaiti_control/description/real_robot_control.xacro
@@ -14,16 +14,16 @@
- -0.5
- 0.5
+ -0.005
+ 0.005
- -0.5
- 0.5
+ -0.005
+ 0.005
diff --git a/src/dcaitirobot/dcaitirobot/twist.py b/src/dcaitirobot/dcaitirobot/twist.py
index def93b6..7fd9f5a 100644
--- a/src/dcaitirobot/dcaitirobot/twist.py
+++ b/src/dcaitirobot/dcaitirobot/twist.py
@@ -7,10 +7,14 @@ from sensor_msgs.msg import Joy
import numpy as np
+SCALE_LINEAR_VELOCITY = 0.5
+SCALE_ANGULAR_VELOCITY = 0.4
+PUBLISH_FREQUENCY_HZ = 10
+
def calc_speed_from_joy(x, y):
- linear = -y
- angular = -x
+ linear = -y * SCALE_LINEAR_VELOCITY
+ angular = x * SCALE_ANGULAR_VELOCITY
return linear, angular
@@ -18,19 +22,22 @@ class TwistPublisher(Node):
def __init__(self):
super().__init__('twist_publisher')
- self.publisher_ = self.create_publisher(Twist, 'cmd_vel', 1)
+ self.linear = 0.0
+ self.angular = 0.0
+ self.publisher_ = self.create_publisher(Twist, '/diff_cont/cmd_vel_unstamped', 1)
self.create_subscription(Joy, "/joy", self.joy_callback, 1)
-
+ self.timer = self.create_timer(1/PUBLISH_FREQUENCY_HZ, self.timer_callback)
def joy_callback(self, joy_message):
x, y = joy_message.axes[:2]
- linear, angular = calc_speed_from_joy(x,y)
+ self.linear, self.angular = calc_speed_from_joy(x,y)
+ def timer_callback(self):
msg = Twist()
- msg.linear.x = linear
- msg.angular.z = angular
+ msg.linear.x = self.linear
+ msg.angular.z = self.angular
self.publisher_.publish(msg)
self.get_logger().info('Publishing: "%s"' % msg)
diff --git a/src/dcaitirobot/launch/remote_control_launch.py b/src/dcaitirobot/launch/remote_control_launch.py
index 5a0b90b..193078a 100644
--- a/src/dcaitirobot/launch/remote_control_launch.py
+++ b/src/dcaitirobot/launch/remote_control_launch.py
@@ -12,10 +12,5 @@ def generate_launch_description():
package='dcaitirobot',
executable='twistcalc',
name='twistcalc',
- ),
- Node(
- package='dcaitirobot',
- executable='serial_comms',
- name='serial',
)
- ])
\ No newline at end of file
+ ])