Ich bekomme es nicht hin, den evotrainer zum laufen zu bekommen
Alle benötigte Software ist installiert, alles Hardware soweit ich weiss auch, jedoch startet der fahr-node nicht
[20230328_22-49-51]-[INFO ] BaseControllerROS: start init process!
[20230328_22-49-51]-[INFO ] BaseControllerROS: Loading config for 2 motorshields
[20230328_22-49-51]-[INFO ] BaseControllerROS: Enable ms1: 1
[20230328_22-49-51]-[INFO ] BaseControllerROS: --------------------------
[20230328_22-49-51]-[INFO ] BaseControllerROS: Loading parameters for ms1
[20230328_22-49-51]-[INFO ] BaseControllerROS: Loading parameters for motor0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: adc_conv = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: adc_offs = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: ctrl_mode = 2
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: encoder_res = 12
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: gear_ratio = 298
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: kd = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: ki = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: kp = 5.3
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: motor_mapping = 1
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: pwm_limit = 100
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: rpm_limit = 15
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: type = 2
[20230328_22-49-52]-[INFO ] BaseControllerROS: Loading parameters for motor1
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: adc_conv = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: adc_offs = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: ctrl_mode = 2
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: encoder_res = 12
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: gear_ratio = 298
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: kd = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: ki = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: kp = 5.3
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: motor_mapping = 2
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: pwm_limit = 100
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: rpm_limit = 15
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: type = 2
[20230328_22-49-52]-[INFO ] BaseControllerROS: Enable ms2: 1
[20230328_22-49-52]-[INFO ] BaseControllerROS: --------------------------
[20230328_22-49-52]-[INFO ] BaseControllerROS: Loading parameters for ms2
[20230328_22-49-52]-[INFO ] BaseControllerROS: Loading parameters for motor0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: adc_conv = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: adc_offs = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: ctrl_mode = 2
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: encoder_res = 12
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: gear_ratio = 298
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: kd = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: ki = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: kp = 5.3
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: motor_mapping = 3
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: pwm_limit = 100
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: rpm_limit = 15
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: type = 2
[20230328_22-49-52]-[INFO ] BaseControllerROS: Loading parameters for motor1
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: adc_conv = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: adc_offs = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: ctrl_mode = 2
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: encoder_res = 12
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: gear_ratio = 298
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: kd = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: ki = 0
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: kp = 5.3
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: motor_mapping = 4
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: pwm_limit = 100
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: rpm_limit = 15
[20230328_22-49-52]-[INFO ] BaseControllerROS: received Param: type = 2
[20230328_22-49-52]-[WARN ] MotorManager: set new config, resetting motor manager!
[20230328_22-49-52]-[INFO ] MotorManager: init motorshield with id 1
[20230328_22-49-53]-[ERROR] MotorManager: failed to init ms1
[20230328_22-49-53]-[INFO ] MotorManager: init motor mapping!
[20230328_22-49-53]-[INFO ] MotorManager: mapped 0 motors
[20230328_22-49-53]-[WARN ] MecanumDrive: Motor front left not connected!
[20230328_22-49-53]-[WARN ] MecanumDrive: Motor front right not connected!
[20230328_22-49-53]-[WARN ] MecanumDrive: Motor back right not connected!
[20230328_22-49-53]-[WARN ] MecanumDrive: Motor back left not connected!
[20230328_22-49-53]-[INFO ] MecanumDrive: init state: 0
[20230328_22-49-53]-[ERROR] BaseControllerROS: init process not successful!
[20230328_22-49-53]-[ERROR] BaseControllerROS: Node is not initialized!
[20230328_22-49-53]-[ERROR] BaseControllerROS: Possible Solutions:
[20230328_22-49-53]-[ERROR] BaseControllerROS: [1] Restart node and check if init is successful
[20230328_22-49-53]-[ERROR] BaseControllerROS: [2] Check if the Motorshields are powered
[20230328_22-49-53]-[ERROR] BaseControllerROS: [3] Check if the CAN Interface is initialized
[20230328_22-49-53]-[ERROR] BaseControllerROS: [4] Check if all parameters are set correctly
[20230328_22-49-53]-[ERROR] BaseControllerROS: [5] Check if some motor connections are broken
[20230328_22-49-53]-[ERROR] BaseControllerROS: [6] Update firmware if versions mismatch
Wie man sieht, scheint es nicht die motor-shields über CAN zu finden zu können
Was ich eingerichtet habe:
/etc/network/interfaces
:
auto can0
iface can0 can static
bitrate 500000
~/catkin_ws/src/evo_rd_platform_example/launch/evo_evotrainer_base_driver.launch
<?xml version="1.0"?>
<launch>
<arg name="NodeName" default="EvoBaseController" />
<arg name="kp" default="5.3" />
<arg name="ki" default="0.0" />
<node name="$(arg NodeName)" pkg="evo_rd_platform_example" type="base_controller_node" output="screen" >
<param name="loop_rate_hz" value="30.0" />
<!-- Subscribers -->
<param name="topic_sub_cmd_vel" value="cmd_vel" />
<param name="topic_sub_cmd_lift" value="cmd_lift" />
<!-- Publishers -->
<param name="topic_pub_odom" value="odom" />
<param name="topic_pub_enable_signal_off" value="enable_signal_off" />
<param name="odom_frame_id" value="odom" />
<param name="odom_child_frame_id" value="base_footprint" />
<!-- Joint State publisher -->
<param name="enable_joint_state_publisher" value="true" />
<!-- enable tf -->
<param name="enable_odom_tf" value="true" />
<!-- can interface -->
<param name="can_interface_name" value="can0" />
<!-- behaviour timeouts -->
<param name="com_timeout_s" value="0.5" />
<param name="cmd_vel_timeout_s" value="0.5" />
<param name="cmd_lift_timeout_s" value="0.5" />
<!-- base params -->
<param name="debug_motor_mapping" value="false" />
<param name="wheel_radius_in_m" value="0.058" />
<param name="wheel_distance_front_back_in_m" value="0.117" />
<param name="wheel_distance_left_right_in_m" value="0.181" />
<!-- covariances -->
<param name="covariance_pos_x" value="1.0" />
<param name="covariance_pos_y" value="1.0" />
<param name="covariance_pos_yaw" value="1.0" />
<param name="covariance_vel_x" value="1.0" />
<param name="covariance_vel_y" value="1.0" />
<param name="covariance_vel_yaw" value="1.0" />
</node>
<!-- Motor Mapping drives: 0 = no_pos, 1=front_left, 2=front_right, 3=back_right, 4=back_left-->
<!-- Motor Types: 0 = no_type, 1=lift, 2=drive-->
<group ns="$(arg NodeName)">
<param name="init_n_motorshields" value="2" />
<group ns="ms1">
<param name="timeout_ms" value="150" />
<param name="enable" value="true" />
<group ns="motor0">
<param name="type" value="2" />
<param name="ctrl_mode" value="2" />
<param name="kp" value="$(arg kp)" />
<param name="ki" value="$(arg ki)" />
<param name="kd" value="0.0" />
<param name="pwm_limit" value="100.0" />
<param name="rpm_limit" value="15.0" />
<param name="gear_ratio" value="298.0" />
<param name="encoder_res" value="12.0" />
<param name="adc_conv" value="0.0" />
<param name="adc_offs" value="0.0" />
<param name="motor_mapping" value="1" />
</group>
<group ns="motor1">
<param name="type" value="2" />
<param name="ctrl_mode" value="2" />
<param name="kp" value="$(arg kp)" />
<param name="ki" value="$(arg ki)" />
<param name="kd" value="0.0" />
<param name="pwm_limit" value="100.0" />
<param name="rpm_limit" value="15.0" />
<param name="gear_ratio" value="298.0" />
<param name="encoder_res" value="12.0" />
<param name="adc_conv" value="0.0" />
<param name="adc_offs" value="0.0" />
<param name="motor_mapping" value="2" />
</group>
</group>
<group ns="ms2">
<param name="timeout_ms" value="150" />
<param name="enable" value="true" />
<group ns="motor0">
<param name="type" value="2" />
<param name="ctrl_mode" value="2" />
<param name="kp" value="$(arg kp)" />
<param name="ki" value="$(arg ki)" />
<param name="kd" value="0.0" />
<param name="pwm_limit" value="100.0" />
<param name="rpm_limit" value="15.0" />
<param name="gear_ratio" value="298.0" />
<param name="encoder_res" value="12.0" />
<param name="adc_conv" value="0.0" />
<param name="adc_offs" value="0.0" />
<param name="motor_mapping" value="3" />
</group>
<group ns="motor1">
<param name="type" value="2" />
<param name="ctrl_mode" value="2" />
<param name="kp" value="$(arg kp)" />
<param name="ki" value="$(arg ki)" />
<param name="kd" value="0.0" />
<param name="pwm_limit" value="100.0" />
<param name="rpm_limit" value="15.0" />
<param name="gear_ratio" value="298.0" />
<param name="encoder_res" value="12.0" />
<param name="adc_conv" value="0.0" />
<param name="adc_offs" value="0.0" />
<param name="motor_mapping" value="4" />
</group>
</group>
</group>
</launch>
/etc/systemd/system/alive-pin.service
[Unit]
description = Set the alive pin for the evotrainer platform
[Service]
Type = oneshot
ExecStart = /bin/sh -c 'echo "22" >/sys/class/gpio/export && echo "out" >/sys/class/gpio/gpio22/direction && echo "1" >/sys/class/gpio/gpio22/value'
[Install]
WantedBy = multi-user.target
symlink zu
/etc/systemd/system/multi-user.target.wants/alive-pin.service
(autostart)
/boot/config.txt
[...]
# enable USB-OtG Network
dtoverlay=dwc2
# enable can
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
# GPIO config for evotrainer platform
dtoverlay=gpio-shutdown,gpio_pin=17,active_low=1,gpio_pull=up
gpio=22=op,pl,dh
Anderes Zeug:
ifconfig output
can0: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 78799 bytes 393995 (384.7 KiB)
RX errors 0 dropped 4636 overruns 0 frame 0
TX packets 3 bytes 12 (12.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[...]
LEDs
Name | Status |
---|---|
READY | grün, an |
CHARGE | aus |
FAULT | aus |
LED 5 | rot, blinkt (1x/s) |
LED 6 | grün, an |
LED 7 | grün, an |
candump output
can0 321 [5] A0 00 00 00 00
can0 320 [5] A0 00 00 00 00
can0 321 [5] A0 00 00 00 00
can0 320 [5] A0 00 00 00 00
[...]
inhalt des catkin workspaces
src/
├── CMakeLists.txt -> /home/pi/.ros_catkin_ws/install_isolated/share/catkin/cmake/toplevel.cmake
├── evo_dcdc_shield_interface
├── evo_logger
├── evo_motor_shield_interface
├── evo_rd_platform
├── evo_rd_platform_example
├── evo_robot_base_interface
└── evo_tof_board_interface
Ist vielleicht die Firmware der controller nicht kompatibel mit dem ros Knoten?
Oder habe ich mich irgendwo vertippt?
Vielen Dank in voraus,
Sam