Search found 59 matches

by elpimous12
Wed 8. May 2024, 20:34
Forum: Linux
Topic: needed wait time for Status return ?
Replies: 3
Views: 2665

Re: needed wait time for Status return ?

Hello Marvin,

I need to call 12 ids, 3 per PEAK M2 port, on a 48 bytes frame, as fast as possible.

on my ubuntu 20.04 RT, i send 12 frames (48 bytes), then read 12 others .

I'd like to reach anything like 500hz

My computer is up xtreme i7.

I'd like to use a pause, but 10us could be enouth to ...
by elpimous12
Wed 8. May 2024, 15:27
Forum: Linux
Topic: needed wait time for Status return ?
Replies: 3
Views: 2665

needed wait time for Status return ?

hello, in my function :

do {
Status = CAN_WriteFD(port, &moteus_tx_msg);
}
while (Status != PCAN_ERROR_OK);
return true;

do I need a usleep(???) like this :

do {
Status = CAN_WriteFD(port, &moteus_tx_msg);
usleep(50);
}
while (Status != PCAN_ERROR_OK);
return true;

Thanks the team.
by elpimous12
Thu 4. Apr 2024, 23:38
Forum: Linux
Topic: Linux (CharDev) PCANBasic: Only read specific ID from queue? Also: How to reset Interface?
Replies: 6
Views: 5423

Re: Linux (CharDev) PCANBasic: Only read specific ID from queue? Also: How to reset Interface?

tested with a buffer (moteus_rx_msg_copy), works perfectly !!!

bool YloTwoPcanToMoteus::read_moteus_RX_queue(int id, int port, float& position, float& velocity, float& torque, float& voltage, float& temperature, float& fault){
moteus_rx_msg.ID = 0x8000 | id;

// Créer une copie du message RX ...
by elpimous12
Tue 2. Apr 2024, 09:50
Forum: Linux
Topic: Linux (CharDev) PCANBasic: Only read specific ID from queue? Also: How to reset Interface?
Replies: 6
Views: 5423

Linux (CharDev) PCANBasic: Only read specific ID from queue? Also: How to reset Interface?

Hello, using 3 ID's on each (CanFD M2 4 can board) port.
I'd like to read specific ID until it queue is empty, without erasing queues for others ID on same port.
Any idea ?? (C++)
by elpimous12
Fri 29. Mar 2024, 20:13
Forum: Linux
Topic: Linux (CharDev) PCANBasic: Same ID received on all Channels
Replies: 2
Views: 3651

Re: Linux (CharDev) PCANBasic: Same ID received on all Channels

I call read_moteus_RX_queue() like this :

for (unsigned int jj=0; jj<3; ++jj)
{
// Reset values
float RX_pos = 0.0;

int port = command.motor_adapters_[jj].getPort(); // PCAN_DEV1

command.read_moteus_RX_queue(jj, port, RX_pos); // query values;
usleep(10);
}

RX_pos for ID 1, 2, 3 return ...
by elpimous12
Fri 29. Mar 2024, 20:09
Forum: Linux
Topic: Linux (CharDev) PCANBasic: Same ID received on all Channels
Replies: 2
Views: 3651

Linux (CharDev) PCANBasic: Same ID received on all Channels

Hello the team, please a small help
- Working on ubuntu 20.04 RT,
- Peak CANFD M2 4 ports
- I have 12 ID's, 3 by CANFD port.

Need to query each ID, be certan to receive anything , and free queue after each end port query.

bool read_moteus_RX_queue(int id, int port, float& position) {
moteus_rx ...
by elpimous12
Sun 23. Apr 2023, 22:47
Forum: Linux
Topic: read or send multiple frame same time (peak 4canM2) c++
Replies: 3
Views: 7645

Re: read or send multiple frame same time (peak 4canM2) c++

Hey, Mr Maidhof.
Well, I'm trying to have frames transmissions as solid as possible.
- Using PCAN-M.2 board with 4 ports, on up xtreme i7.
- ubuntu 20.04 RT
- TPCANBitrateFD BitrateFD = (char*) "f_clock_mhz = 80, nom_brp = 1, nom_tseg1 = 50, nom_tseg2 = 29, nom_sjw = 10, data_brp = 1, data_tseg1 = 8 ...
by elpimous12
Thu 20. Apr 2023, 21:52
Forum: Linux
Topic: read or send multiple frame same time (peak 4canM2) c++
Replies: 3
Views: 7645

read or send multiple frame same time (peak 4canM2) c++

Hello the team.
Is it possible to send many frames same times ?
ex : send a request on id 1, 2, 3 on PCAN_DEV1, and 4, 5, 6 on PCAN_DEV2
then read all frames same time.

In fact, I need a usleep(200) between query frame and it read. And I need it for 12 ID's

This parallelism could make me use only ...