Open Vishnu-Vijay95 opened 3 years ago
You don't need to use these macros or these files.
If you want to port this library just modify kobuki_init_serial
, kobuki_write_bytes
and kobuki_read_bytes
with your Olimex code and it should work.
Remove the macros that are not used or giving problems.
Thanks @pablogs9 , i will remove these files, these are the the function which i am also making the changes, i have kept all the headers for compilation which i thought will have some dependency, one more doubt which i have is kobuki bringup part in the code. Can you point out the code used by for this purpose.
Could you be more specific, I don't understand the question.
You have sample code here: https://github.com/pablogs9/kobuki_espidf_component/blob/main/examples/basic_movement/main/main.c
Ok, sorry for that. normally while running kobuki turtlebot2 package in ROS1, we launch a script file to bring up the kobuki robot, such a code i didn't understand from your code. Can you point out that?
But this is not a ROS library, this is just a C99 library that interfaces with the Kobuki serial interface, in this case in the ESP32.
So you have an API for sending and receiving messages from the Kobuki in your MCU.
@pablogs9 , you have used mutex_lock and mutex_unlock in kubuki.c, is it necessary, i didn't got the logic behind.
They are necessary since kobuki_loop
is going to run in a thread and kobuki_set_speed_command
is going to be called from another thread and should be synchronized.
Ok, that resource sharing has to be done by the RTOS right? these are linux API's right?
i included the mutex lock, but the arm cross compiler is showing an error undefined reference to `pthread_mutex_lock'
This a component for ESP32 and IDF which is not an ARM architecture. I guess that you should use the mutex implementation of your RTOS.
I removed the mutex implementation and compiled the file and i flashed the board with the elf file. connected with the microROS agent in laptop using a usb uart bridge and the listed ros2 topic list
. am getting the following topics
and while echoing the topic /cmd_vel its showing no msg
cmd vel is a should be a subscription
i mean the robot will not send cmd vel, will receive cmd vel
I connected with the robot its not getting command
You mean this right
RCCHECK(rclc_subscription_init_best_effort(
&cmd_vel_sub,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(geometry_msgs, msg, Twist),
"cmd_vel"));
Yes, but this micro-ROS issues should be in a micro-ROS repo, not here.
Sorry mistakenly closed the issue, i am keeping it open here
Hi @pablogs9, i am writing a custom driver for kobuki, i tested your kobuki esp demo and the code running perfectly, i just took a frame from the esp uart and i am listing it here, AA 55 05 01 04 64 00 00 00 67
, i am confused whether 67 is the CRC for the frame. Can you show which CRC algorithm is used here. i checked with XOR all the bits but didn't get 67 hex
Hi @pablogs9 , i am trying to port this code to Olimex board, i have some issue with the macros defined in kobuki_platform.h such as CONFIG_KOBUKI_UART_PORT,CONFIG_KOBUKI_UART_TXD,CONFIG_KOBUKI_UART_RXD,CONFIG_KOBUKI_UART_BUFFER_SIZE etc. Kindly let me know in which reference you have used this variables to initialize the macros. Whether they are initialized during runtime or they are ESP platform oriented data. Eager for your reply :))