Created by [ Rowan Dempster], last modified by [ Rowan Dempster] on Mar 05, 2020
Current Branch Used In the Car: py_imp_to_develop --> commit 9c568.… --> commited Aug 17th
In this document, the key procedures for using the CANbus of the vehicle during testing.
Once the car has been turned, check to make sure all the cabling is correct. This includes making sure the cabling is connected under the driver's seat (make sure the CE cable matches the CE cable, and the HS cable matches the cable. For control testing, the LS bus is not important.)
If all the cabling is done correctly, and the kernel driver is loaded, then run the following commands and you should see a constant stream of data output on the terminal.
candump can0 --> Mapped to High Speed (HS) CANbus
candump can1 --> Mapped to Chassis Expansion (CE) CANbus
To run the CANbus interfacing module as a whole
roslaunch state_machine can_nodes.launch steering:=true velocity:=true
The CANbus ROS module listens for messages for messages from Path Planning, specifically the /feedback_desired_output topic. It takes the path_planning_msgs/DesiredOutput message as its input for control of wheel angle and torque values.
Currently there are two pays to test this module without running the path planning module.
The first is by running the keyboard controlled test interface:
rosrun py_can_interface key_telop_test.py
If this script is run after launching the CANbus interface, the torque and steering can be controlled using the keyboard keys! Be careful using this, as this test interface doesn't map to the smoothest driving experience.
rosrun py_can_interface vehicle_transmission.py
Note that in order for this node to function properply, it requires data from publish_CE and publish_HS, and requires vehicle_braking to be running. Braking is required because certain transmission changes require the brake to be pressed. Note that transmission should be started last to allow for proper initialization. At this point, the user can transmit transmission commands as follows from terminal:
rostopic pub /transmission_request embedded_msgs/Trans_Req_CAN "Drive"
The options for the request string are Drive, Park, Neutral, Reverse.
The general strucutre of the CAN interfacing ROS package is as follows:
├── CMakeLists.txt
├── dbc
│ ├── ADS_CE_GM_Confidential.dbc
│ ├── ADS_HS_GM_Confidential.dbc
│ └── ADS_LS_GM_Confidential.dbc
├── launch
│ ├── publish_CAN_data.launch
│ ├── start_pycan_interface.launch
│ └── telop_pycan_interface.launch
├── package.xml
└── scripts
├── can_helper_utils.py
├── central_state_machine.py
├── key_telop_test.py
├── other_publish_speed.py
├── publish_CE.py
├── publish_HS.py
├── publish_LS.py
├── publish_speed.py
├── publish_speed_using_rosbag.py
├── publish_torque_test.py
├── publish_VCAN.py
├── vehicle_braking.py
├── vehicle_steering.py
├── vehicle_torque.py
└── vehicle_transmission.py
The publish_CE, publish_HS, and publish_LS nodes are meant for reading data from the car. The data from these nodes are used for feedback by Path Planning and as sensory inputs to other software modules. The vehicle_torque, vehicle_braking, vehicle_steering, vehicle_transmissions nodes and more deal with transmitting control signals to the vehicle's CAN, and actuating motor commands.
If individual nodes are needed to be run, each node can be run independently:
rosrun py_can_interface <node_name>
Note that certain nodes depend on initialization data from other nodes. For example, for most of the actuation nodes (e.g. vehicle_torque), the publish_HS node is required to run in order to initialize the car into a mode of autonomy.
A common problem is that the kernel driver that creates CAN sockets are not binded by the operating system on the Crystal Rugged. An indication that this issue has occured is from the following error message:
SIOCGIFINDEX: No such device
To fix this, run the created shell script:
sudo ./setup_can_kernel.sh
This will reinstall and modprobe the kernel driver with the PEAK PCIe card installed on the Crystal Rugged. Afterwards check candump can0 to see if signals are coming through now. If so, then we are good to go!
Document generated by Confluence on Nov 28, 2021 22:40