motor_power_status == "1" のときに controller_vel_publisher.py が使えない
|
if motor_power_status == "1": |
|
with open(lfile, "r") as lf, \ |
|
open(rfile, "r") as rf: |
|
lhz_str = lf.readline().rstrip() |
|
rhz_str = rf.readline().rstrip() |
|
if len(lhz_str) == 0: |
|
lhz = 0 |
|
else: |
|
try: |
|
lhz = int(lhz_str) |
|
except: |
|
lhz = 0 |
|
if len(rhz_str) == 0: |
|
rhz = 0 |
|
else: |
|
try: |
|
rhz = int(rhz_str) |
|
except: |
|
rhz = 0 |
|
vel.linear.x = (lhz + rhz) * 9 * math.pi / 160000.0 |
|
vel.angular.z = (rhz - lhz) * math.pi / 800.0 |
|
print(vel) |
|
pub.publish(vel) |
motor_power_status == "1"のときにcontroller_vel_publisher.pyが使えないraspimouse_sim/raspimouse_control/scripts/virtual_motors.py
Lines 24 to 46 in 290eb57