ars_40X
ars_40X copied to clipboard
Can this project fit multiple ars_40X?
if i want to fit multiple ars_40X, can it fit ?
@wangwenqiangGitHub it will depend on whether you are using same can bus for multiple ars_40X or different can buses.
- 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
- If you are using different can buses, then just changing the "can0" to required value for second radar should work https://github.com/Project-MANAS/ars_40X/blob/506ebaa6d120ed2e96b31f1c6212dfe132c16a2b/src/ars_40X_can.cpp#L9
ok, I want to use same canbus for different ars-40X
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:
https://github.com/Project-MANAS/ars_40X/blob/506ebaa6d120ed2e96b31f1c6212dfe132c16a2b/include/ars_40X/ars_40X_can.hpp#L21-L43.
All of them have to be added with 0x10 so RadarCfg will become 0x200 -> 0x210 and so on.
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.
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:
https://github.com/Project-MANAS/ars_40X/blob/506ebaa6d120ed2e96b31f1c6212dfe132c16a2b/include/ars_40X/ars_40X_can.hpp#L21-L43
. 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:
https://github.com/Project-MANAS/ars_40X/blob/506ebaa6d120ed2e96b31f1c6212dfe132c16a2b/include/ars_40X/ars_40X_can.hpp#L21-L43
. 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
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
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.