Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this project fit multiple ars_40X? #2

Open
wangwenqiangGitHub opened this issue Jul 1, 2020 · 7 comments
Open

Can this project fit multiple ars_40X? #2

wangwenqiangGitHub opened this issue Jul 1, 2020 · 7 comments

Comments

@wangwenqiangGitHub
Copy link

if i want to fit multiple ars_40X, can it fit ?

@shiveshkhaitan
Copy link
Member

@wangwenqiangGitHub it will depend on whether you are using same can bus for multiple ars_40X or different can buses.

  1. Same canbus: In this case, different ars-40X will have to configured as mentioned in the manual for multiple connections. Different radars will then send message to different message boxes. The new message boxes will have to configured in the code. It will require some work to change that
  2. If you are using different can buses, then just changing the "can0" to required value for second radar should work
    can_("can0") {

@wangwenqiangGitHub
Copy link
Author

ok, I want to use same canbus for different ars-40X

@shiveshkhaitan
Copy link
Member

This is from the manual.

To be able to add up to eight sensors to one CAN bus, the sensor ID can
be configured, which will change the message IDs. The following table gives the message
IDs for sensor ID 0. For the sensor IDs 0 to 7 the message ID can be calculated by
MsgId = MsgId_0 + SensorId * 0x10.

So the message ids will be different for the two sensors once you have configured them. (The sensor ids can be set using the ros service call /set_sensor_id but only one radar should be connected while configuring otherwise all radars would receive the same configuration). After configuring the individual radars, if you are using just two radars, maybe you run two versions of ars_40X_ros and change the message ids for the second radar here:

typedef enum can_messages {
RadarCfg = 0x200,
RadarState = 0x201,
FilterCfg = 0x202,
FilterState_Header = 0x203,
FilterState_Cfg = 0x204,
CollDetCfg = 0x400,
CollDetRegionCfg = 0x401,
CollDetState = 0x408,
CollDetRegionState = 0x402,
SpeedInformation = 0x300,
YawRateInformation = 0x301,
Cluster_0_Status = 0x600,
Cluster_1_General = 0x701,
Cluster_2_Quality = 0x702,
Object_0_Status = 0x60A,
Object_1_General = 0x60B,
Object_2_Quality = 0x60C,
Object_3_Extended = 0x60D,
Object_4_Warning = 0x60E,
VersionID = 0x700,
CollDetRelayCtrl = 0x8,
} can_messages;
.

All of them have to be added with 0x10 so RadarCfg will become 0x200 -> 0x210 and so on.

@sven-hoek
Copy link

I wrote a patch to make the radar use a configurable sensor_id, which can be set via roslaunch arg.

This also makes it possible to use the radar without problems after calling the set_sensor_id service without restarting the node. After a restart, the roslaunch arg/param has to be set to the new sensor_id, of course.

I have only tested it with one radar but now it should work with multiples. I'm creating a pull request.

@wangwenqiangGitHub
Copy link
Author

This is from the manual.

To be able to add up to eight sensors to one CAN bus, the sensor ID can
be configured, which will change the message IDs. The following table gives the message
IDs for sensor ID 0. For the sensor IDs 0 to 7 the message ID can be calculated by
MsgId = MsgId_0 + SensorId * 0x10.

So the message ids will be different for the two sensors once you have configured them. (The sensor ids can be set using the ros service call /set_sensor_id but only one radar should be connected while configuring otherwise all radars would receive the same configuration). After configuring the individual radars, if you are using just two radars, maybe you run two versions of ars_40X_ros and change the message ids for the second radar here:

typedef enum can_messages {
RadarCfg = 0x200,
RadarState = 0x201,
FilterCfg = 0x202,
FilterState_Header = 0x203,
FilterState_Cfg = 0x204,
CollDetCfg = 0x400,
CollDetRegionCfg = 0x401,
CollDetState = 0x408,
CollDetRegionState = 0x402,
SpeedInformation = 0x300,
YawRateInformation = 0x301,
Cluster_0_Status = 0x600,
Cluster_1_General = 0x701,
Cluster_2_Quality = 0x702,
Object_0_Status = 0x60A,
Object_1_General = 0x60B,
Object_2_Quality = 0x60C,
Object_3_Extended = 0x60D,
Object_4_Warning = 0x60E,
VersionID = 0x700,
CollDetRelayCtrl = 0x8,
} can_messages;

.
All of them have to be added with 0x10 so RadarCfg will become 0x200 -> 0x210 and so on.

This is from the manual.

To be able to add up to eight sensors to one CAN bus, the sensor ID can
be configured, which will change the message IDs. The following table gives the message
IDs for sensor ID 0. For the sensor IDs 0 to 7 the message ID can be calculated by
MsgId = MsgId_0 + SensorId * 0x10.

So the message ids will be different for the two sensors once you have configured them. (The sensor ids can be set using the ros service call /set_sensor_id but only one radar should be connected while configuring otherwise all radars would receive the same configuration). After configuring the individual radars, if you are using just two radars, maybe you run two versions of ars_40X_ros and change the message ids for the second radar here:

typedef enum can_messages {
RadarCfg = 0x200,
RadarState = 0x201,
FilterCfg = 0x202,
FilterState_Header = 0x203,
FilterState_Cfg = 0x204,
CollDetCfg = 0x400,
CollDetRegionCfg = 0x401,
CollDetState = 0x408,
CollDetRegionState = 0x402,
SpeedInformation = 0x300,
YawRateInformation = 0x301,
Cluster_0_Status = 0x600,
Cluster_1_General = 0x701,
Cluster_2_Quality = 0x702,
Object_0_Status = 0x60A,
Object_1_General = 0x60B,
Object_2_Quality = 0x60C,
Object_3_Extended = 0x60D,
Object_4_Warning = 0x60E,
VersionID = 0x700,
CollDetRelayCtrl = 0x8,
} can_messages;

.
All of them have to be added with 0x10 so RadarCfg will become 0x200 -> 0x210 and so on.

thanks, I will change multiple ars_40X sensor_id, Then I used them in same CAN bus

@wangwenqiangGitHub
Copy link
Author

I wrote a patch to make the radar use a configurable sensor_id, which can be set via roslaunch arg.

This also makes it possible to use the radar without problems after calling the set_sensor_id service without restarting the node. After a restart, the roslaunch arg/param has to be set to the new sensor_id, of course.

I have only tested it with one radar but now it should work with multiples. I'm creating a pull request.

I see your changed ars_40X ROS project , Maybe have some problem use multiple ars_40X sensor in same CAN bus. we deal with messages in one SockeCAN read() function, after that, We publish this multiple ars_40X sensor messages to ROS

@sven-hoek
Copy link

Not sure if the read() of one node takes away the messages that another node needs, but yes, it could possibly be a problem. When I had 2 radars connected to one CAN-bus, it seemed to work, but I didn't get to test it thoroughly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants