Comments (5)
Hi @vitoruapt and @miguelriemoliveira ,
So, me and @manuelgitgomes thought that it was very weird for the arduino only giving positive values so we decided to change the code to a more precise approach using two interrupts.
This worked! You can se a video when we drive 1.80m (the wheels' perimeter) and the pulses the encoder gives us:
pulses_2.mp4
Here is the car moving :
https://user-images.githubusercontent.com/92535336/170281740-b62c4b45-823a-4222-829d-8741e6e37692.mp4
(Beware, it has sound!)
We also send these values to the atlascar2 cmd_vel topic which the ackermann_controller uses to calculate the odometry so we can see the car moving in the simulation:
With the measuring tape we measured 1.50m (rough) and the simulation moved 1.63 , this needs more tests because the gazebo has simulated forces and inertias! With rviz and with longer paths we will be able to see more realistic results! We hope to do it next week when the eletric panel is completed
from atlascar2.
Fine! Double interrupt was after all a positive approach ;-)
@Sarxell A doubt remains: what is the maximal speed of the car for the Arduino not to skip pulses? Is it possible to calculate that?
from atlascar2.
Hi!
It "is" possible!
Checking the atlascar2's specifications it says the max speed of the car is 130km/h
130 km/h -> 36.1 m/s
We can check the number of turns the wheel gives using its perimeter.
With a radius of 0.285 m -> 2pir = 1.79 m
36.1/1.79 = 20.16 turns per second
Since the encoder as 1000 ppr -> 1000 * 20.16 = 20160 pulses per second
BUT, checking the code we have two interrupts both on change! which means x4 that value for interrupts:
80 640 interrupts/second ... So we need a little more than 80 kHz if I'm thinking right but I can be mistaken.
This seems small since the Arduino says that it provides 16/20 MHz ... But it doesn't.
If we are not using it sure but each instruction decreases this value by a lot. A realistic value by the forums is 275 kHz if the Arduino only interrupts or does a small program ...So in reality I don't know since it depends on the code... we could test this on the road but without the electric panel we can only drive inside DEM at low speeds...
from atlascar2.
OK. It seems reasonable, however I do not understand why you have interrupts on both the rising and falling edges of the pulse. Wouldn't it be enough to have only in one of them? Concerning maximal interrupt rates in Arduino, you can check some more tentative realistic calculations at https://forum.arduino.cc/t/max-interrupts-second/357256/8.
With the increase of speed of the car, less time may be left available in the Arduino to dispatch the message to the CAN bus. So, perhaps, that's one more reason to include the Arduino time stamp in the CAN message along with the encoder value.
from atlascar2.
Solved
from atlascar2.
Related Issues (20)
- Test of the point grey flea 2 camera HOT 13
- test of the LIDAR Sick LD MRS HOT 2
- novatel hardware HOT 9
- Find/Create odom messages for atlascar2 ackermann simulation HOT 7
- ATLAS PC boots very slow HOT 6
- Changing ackermann_steering_controller HOT 2
- Receive vehicle speed and steering angle from CAN messages HOT 34
- Calibrating AtlasCar2 with VLP HOT 9
- Add sick lms151 to the atlascar2 simulation HOT 4
- Create a sick lrms gazebo sensor HOT 6
- Consistency between simulation and live mode HOT 1
- Install odometer from Atlascar1 in Atlascar2 HOT 23
- Odometry drift in ackermann controller HOT 7
- Separate how to run from instalation HOT 1
- Odometry implementation using an incremental encoder HOT 28
- Odometry calibration in AtlasCar2 HOT 35
- Publish can messages to ROS and process their data HOT 4
- Labeling in the data collector HOT 1
- Interactive pattern wrong reference frame HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atlascar2.