Skip to content

Commit

Permalink
Revert to the previous state
Browse files Browse the repository at this point in the history
Signed-off-by: Reiji Nakano <[email protected]>

Restored to the latest state due to data loss.

Signed-off-by: kozenikanta <[email protected]>

Organize directory structure due to inconsistencies

Signed-off-by: kozenikanta <[email protected]>

Made changes for the pull request

Signed-off-by: Reiji Nakano <[email protected]>

change can_all_node to cabot_can_node

Signed-off-by: Daisuke Sato <[email protected]>

Remove unnecessary variables

Signed-off-by: kozenikanta <[email protected]>
  • Loading branch information
ReijiNakano authored and daisukes committed Nov 29, 2024
1 parent 9f9e9de commit 3a7afff
Show file tree
Hide file tree
Showing 24 changed files with 1,180 additions and 652 deletions.
2 changes: 1 addition & 1 deletion cabot_base/launch/cabot3.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def has_flag(flag_name):
),
Node(
package='cabot_can',
executable='can_all_node',
executable='cabot_can_node',
namespace='/cabot',
name='cabot_can',
output=output,
Expand Down
29 changes: 26 additions & 3 deletions cabot_can/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,34 @@ find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(diagnostic_updater REQUIRED)
add_executable(cabot_can_node
src/cabot_can_node.cpp
)
ament_target_dependencies(cabot_can_node
diagnostic_updater
rclcpp
std_msgs
sensor_msgs
std_srvs
)

add_executable(can_all_node src/can_all_node.cpp)
ament_target_dependencies(can_all_node rclcpp std_msgs sensor_msgs std_srvs)
if(BUILD_TESTING)
find_package(ament_cmake_copyright REQUIRED)
find_package(ament_cmake_cpplint REQUIRED)
find_package(ament_cmake_lint_cmake REQUIRED)
find_package(ament_cmake_uncrustify REQUIRED)
find_package(ament_cmake_xmllint REQUIRED)

install(TARGETS can_all_node
set(MAX_LINE_LENGTH 200)
ament_copyright()
ament_cpplint(MAX_LINE_LENGTH ${MAX_LINE_LENGTH})
ament_lint_cmake()
ament_uncrustify(MAX_LINE_LENGTH ${MAX_LINE_LENGTH})
ament_xmllint()
endif()

install(TARGETS cabot_can_node
DESTINATION lib/${PROJECT_NAME})

ament_package()
36 changes: 36 additions & 0 deletions cabot_can/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# cabot_can
## Node
- cabot_can_node
### Services
- **run_imu_calibration** (std_srvs::srv::Trigger)
- This service will publish data from '/calibration' by sending the service if all 4 bits of the data received from CAN ID: 037 are equal to 3.
### Parameters
- **publish_rate** (int) - default=`200`
- publish_rate
- **can_interface** (string) - default=`can0`
- can interface numberinterface
- **imu_frame_id** (string) - default=`imu_frame`
- imu frame id
- **calibration_params** (int[22]) - default=`(22,0)`
- Can be set by setting parameters in calibration_params of params.yaml
### Publishers
- **/calibration** (int[22]): only publishes values when `/run_imu_calibration` is true
- **/imu** (sensor_msgs/msg/Imu): IMU data - 100Hz
- **/pressure**,**/bme/pressure** (sensor_msgs/msg/FluidPressure): Pressure data - 2Hz
- **/pushed** (std_msgs/msg/Int8): button status (bit0-4 represents each button) - 50Hz
- **/temparature_1**,**/temparature_2**,**/temparature_3**,**/temparature_4**,**/temparature_5**,**/bme/temperature**(sensor_msgs/msg/Temperature): Temperature data - 2Hz
- **/touch**, (std_msgs/msg/Int16): `1` if touched else `0`,
TOF Sensor and Capacitive Sensor Integration - 50Hz
- **/capacitive/touch**(std_msgs/msg/Int16): `1` if touched else `0`, Capacitive sensor's - 50Hz
- **/tof/touch**(std_msgs/msg/Int16): `1` if touched else `0`, Tof sensor's - 50Hz
- **/capacitive/touch_raw** (std_msgs/msg/Int16): capacitive sensor's raw value (for debug) - 50Hz
- **/tof/touch_raw** (std_msgs/msg/Int16): tof sensor's raw value (for debug) - 50Hz
- **/wifi** (std_msgs/msg/String): wifi scan string - depends on how often WiFi signal is scanned
- **/servo_pos** (std_msgs/msg/Int16): current position of directional indicator - 50Hz
### Subscribers
- **/vibrator1** (std_msgs/msg/UInt8): front
- **/vibrator3** (std_msgs/msg/UInt8): left
- **/vibrator4** (std_msgs/msg/UInt8): right
- if you publish a `value`, it vibrates corresponding vibrator for `value` x 10 milliseconds (0 - 2550 milliseconds)
- **/servo_target** (std_msgs/msg/Int16): if you publish a `value`, it rotates directional indicator (value: -179 ~ +179)
- **/servo_free** (std_msgs/msg/Bool): `false` -> set free, `true` -> no operation
7 changes: 7 additions & 0 deletions cabot_can/config/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cabot_can_node:
ros__parameters:
calibration_params : [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
can_interface : "can0"
publish_rate : 200
imu_frame_id : "imu_frame"
#vibrator_power : 100
Loading

0 comments on commit 3a7afff

Please sign in to comment.