I'm currently working on a 2WD autonomous robot, and with less than two weeks left of our project we have not achieved autonomy. I've just discovered this LINOROBOT project - it's so cool! I wish I had discovered it earlier.
My questions are: will it work with my setup, and can I complete this project in a week?
We are currently using an NVIDIA TX2 running ROS Kinetic, an RPLidar A2, a BNO05 IMU (connected to the TX2 carrier board via I2C), and a motor controller connected to an Arduino Mega (which communicates with the TX2 using rosserial). Our motor controller drives both wheels and has inputs for the speed and direction of each wheel, and that's it. Our drive motors do have encoders, though we aren't sure how to wire them. It looks like they do fall within the specs needed for LINOROBOT, however.
Anyway, can I make the project work with this hardware? Or do I need to purchase the specific hardware specified for this project? And is it possible to complete the project within our time constraints?
If you have any questions or if anything's unclear, let me know.
Thanks!
Looking at your components, technically it's possible to build your robot using Linorobot's stack. Most of your components are supported except for your IMU and microcontroller. I advise to split the work into different parts and focus on getting the hardware right.
ARDUINO MEGA
I haven't tried an Arduino Mega on this project personally but I believe someone has successfully ported Linorobot on a Mega. Few things to take note:
1. Connect your encoders on interrupt supported pins on Mega.
2. Remember to remap the pins written on the firmware to the pins you're using on your Mega taking note of point no 1. https://github.com/linorobot/linorobot/blob/master/teensy/firmware/lib/config/lino_base_config.h
3. Make sure you connect MOTOR*_PWM pin to a PWM enabled pin on your Mega for L298 driver and MOTOR*_INA and MOTOR*_INB for BTS7960 motor driver.
4. Edit platformio.ini :
From this: https://github.com/linorobot/linorobot/blob/master/teensy/firmware/platformio.ini
To this:
[env:mega]
platform = atmelavr
framework = arduino
board = megaatmega2560
upload_port = /dev/linobase
IMU
1. The only supported IMU is GY-85. You can tweak the firmware accordingly and use a working code for your IMU and pass it to the variables in publishIMU() function: https://github.com/linorobot/linorobot/blob/master/teensy/firmware/src/firmware.ino#L230
2. Alternitively you can use the encoder data to estimate the robot's angular velocity.
Append:
g_imu_z = vel.angular_z;
to: https://github.com/linorobot/linorobot/blob/master/src/lino_base_node.cpp#L25
and comment the following:
https://github.com/linorobot/linorobot/blob/master/src/lino_base_node.cpp#L40
https://github.com/linorobot/linorobot/blob/master/teensy/firmware/src/firmware.ino#L129-L146
change:
g_imu_dt to to g_vel_dt
https://github.com/linorobot/linorobot/blob/master/src/lino_base_node.cpp#L75
After following these porting instructions you can start going through the tutorial. Make sure to check that the robot's odometry is correct before working on the robot's automomy.
Hope these help all the best!!
Are you trying to port a new IMU or use the motor encoder to estimate the angular velocity?
Please take a look at this thread.
https://groups.google.com/forum/m/?utm_medium=email&utm_source=footer#!topic/linorobot/6vlUkd0yAOY
Thanks!